Creating HTML according to files existence in the file system - html

I am writing a web application (I am a newbie), where the markup is created by XSL and XML transformations and the style is declared by css files and also some use of JavaScript. I need to create a web page that part of its content is the information on files in a specific directory in the file system.
Any ideas?

Are you talking about the client's file system, or the server's?
If the client's, what you are asking is basically impossible for security reasons without some specific browser plugins/extensions (like a java applet with the right access) - you probably don't want to get into that.
If you are talking about the server file system, you will need some sort of server side language to read the file(s) and return them to browser requests. The sort of things that do that are PHP, ASP.NET, Ruby on Rails, etc...also look into Server Side Includes - that may be sufficient for your needs.

Do you mean the client's filesystem or the server's filesystem? If it's the client's, these tools are inadequate (as access to the client's OS is severely restricted for security purposes). I think most people go with a Java applet for stuff like that.

Related

Going from webpage to website

I have been coding html/css for some time now, and I've gotten to be proficient at coding single webpages, but I can't figure out how to code a website. Some questions I have are:
Do I need to buy a domain if I want to build a website (for practice)
Are their special things I need to know (such as special tags) that I wouldn't have learned from coding just a single page?
Should I learn how to use a grid if I am coding multiple pages?
You may want to first decide what kind of back end you want (the server side code that builds and delivers the pages) I strongly recommend rails, and a react.rb.
You do not need a domain name.
A great way to start is to use a service like cloud9 which is free, and will get you going in no time. Cloud9 will do a one button setup of a rails environment and get you going.
Another approach is to begin using react.rb and just expand your skill set from the front end towards the server. The react.rb tutorial creates a simple chat application and you can do this all with the tools your already have. Once you have mastered that you can set up a simple rails server and start adding server side persistance (saving data on the server.) This is the approach I recommend, but full discloure: I am one of the leads on the react.rb project so I am very biased.
Well, you can build simple to wonderful STATIC websites from HTML/CSS but if you are talking about some serious web development then you will need to learn a server side scripting language. Most of the websites these days are database driven serverside webpages. There are many serverside programming languages and tutorials for the same out there.
I suggest you start with PHP (for scripting language) and MySql (for database)
Again, the choice of language is totally upto you.
Then you would need to learn about setting up a server on your local computer. For this you will need to learn about (x)-AMP. This would be WAMP, XAMP, MAMP depending on what OS you are using.
If you are only needing to develop a simple CMS website, then there are alot of CMS framework which you can go for, which will not require much of coding.
It seems as if you are looking to connect multiple pages to the same website, so you can navigate between pages. And it seems that you want to practice with local files. If that is the case, you need to first create a local folder for your website and use the a tag in your html files. Inside the a tag, you will need to include an href with the url to your other page. A link to another html page that is saved in the same folder as your original will look like this:
New Page
You will want to use external CSS and JavaScript files to keep all of your pages in the same format.
http://www.w3schools.com/html/html_links.asp
http://www.w3schools.com/tags/tag_link.asp

Why can't a browser display a local ASP.NET file?

I wanted to build a web application that kids could view 4-H Record Book forms, criteria, and examples from a CD. I wanted it to be in a web page format so that it was platform-independent (compatible with Windows, Mac, and Linux). I wanted to write the application in ASP.NET, so that I could reuse pieces of my site (e.g. Master Pages, databound controls). It worked fine while in Debug mode running on my simulator server, but when I attempted to open the files without the server simulator, they simply displayed as blank pages.
I've learned thus far that ASP.NET requires a server to run, but my question is: why does it require a server when so much of ASP.NET is just HTML tags? Also, is there any way I can use ASP.NET features such as Master Pages and Databound controls on a local website?
Output of ASP.NET is html, css and other stuff, but ASP.NET itself is a very complex system that consists of many components, for instance code-behind classes, asp.net controls, event system, routing system, various libraries etc. The server has to somehow (I won't go into details, because it's a way too broad topic to explain like this) assemble the output and it will spit out the generated html, css etc. to the client who requested the file (typically a browser).
Browser itself can only work with final html, css, javascript and so on, but it can't do processing that needs to take place on the server-side.

Java applet on website?

I have been assigned the task of creating a MySQL database which I will host on a server and create a website for a product my friend is selling. The database will store site information such as order information. I have little knowledge of HTML so my solution would be to use a website creater (weebly) and design it. There are then two routes I could take for accessing my database. I am limited to what I can do because all I know is java, c#, and c++. I figured I could create a java applet (which I could easily do) and embed the code of the code of the applet in an applet tag in my weeblys site. There is functionality to embed HTML code in the designer. Using the applet, with my java knowledge I figured I could easily access and insert/extract data from my hosted database. I know that java applets require the JRE and Java browser extension to run, this made me a little hesitant about doing this. Would that be a fine way to approach this project? I need my website to access my database, should I do this in java, or in php. What would be the correct thing for me to do?
What you're describing doesn't sound like a good idea.
First of all, Java Applets are an obsolete technology. The Java plugin isn't nearly as common now as it was in 1998, and security people have been advising that people disable it for years due to a long string of holes in its security model.
Second, it sounds like you're planning on giving the applet direct access to your database. This would require that you make your database externally accessible, which will make access control and data validation difficult.
The standard way to implement this sort of thing is to write a server-side web application (you can use PHP, any one of various server-side Java systems, ASPX, or one of many other platforms) that interacts with the database and generates web pages on demand. The database is hidden behind a firewall, the web application code handles access control and data validation, and the client doesn't need to run unsafe code.

Includes without local server?

I'm making a website, and I like testing everything offline instead of having to upload files with every change I make. The problem is I can't use includes, so when I do upload, I'm going to have to change a lot of the file structure.
I'm not looking to install a local server like WAMP when I just want to use includes. Is there any way?
Not really.
You could process includes statically (e.g., write yourself a Makefile to create the actual HTML files you view locally). There are plenty of template languages out there that could do this. You could, I suppose, even write your templates in JavaScript and let the web browser assemble them.
But really, why wouldn't you want your test environment to match your production environment? This seems silly—if there is something wrong with your includes, you want to find out before you make it live. If you accidentally get a local path to an image (C:\Documents and Settings\…\image.png) in a file, you want to find out. The best way to do this is really to run a webserver locally.

HTML File Upload - Practical Limit?

We are designing an internal web application to which we would like to upload a very large file (100mb). Is an HTML file upload even an option here?
If it is not, what other tools (Java applet, Silverlight, Flash) could we use to perform a file upload this large? Is uploading a file this large practical at all?
Edit: You can assume that there will be appropriate server side code accepting the file upload and handling the data. This question is specifically about the client side interface and the HTML file upload interface.
I'm no expert on file uploading, but my understanding is it's either impossible or very difficult to upload a file with HTML alone. You will probably need some server-side scripting like PHP, JSP, ASP.NET or something to process the upload and persist the file on your web server/database. Any well-designed implementation should allow for a size limit to be set and enforced, but with larger files it would be a good idea to include a progress indicator like a percentage and/or progress bar so the user knows the upload is still working and isn't hanging on slow connections.
I just downloaded this UploadBean component and deployed the WAR under the downloads section on an apache tomcat instance and the SimpleUpload.jsp example worked really well right out of the box. If you're using Java I'd highly recommend this approach.
http://www.javazoom.net/jzservlets/uploadbean/uploadbean.html
with javascript/jQuery/Mootools/Flash there are plugins that allows you to check file size before upload, and basically has server side script as fallback validation as well. Take a look at jQuery Uploadify or Mootools powered fancy upload they use flash and javascript with server side script in the backend. These two plugins use flash + JavaScript on client side
Being that it will be for an internal web application I am assuming you don't have any server-side imposed limits on the server that will be running this. If not then you should be able to upload large files.
See http://www.uploadify.com/ - nice and easy to implement
See http://encodable.com/filechucker/ - good if you are looking for more advanced management for your uploaded files.