This page is not maintained anymore,
and has been archived. The information on this page
must be taken with care, because it might not be valid anymore.
See the demo More information about WebLoadFile Interested? WebLoadFile is now available for free! Back home |
WebLoadFile V01.03-04
Short story: WebLoadFile reads files and passes the content to JavaScript. Client-side JavaScript has some limitations. For example, it is impossible for a webpage to access the server to load files other than .JS files. Usually, the way to solve this problem involves some CGI working on the server, reading the files there and then building some HTML files "on the fly" with the file's content. In some cases, however, this solution is not possible. It is also impossible to read the list of all files present in a directory, or, for a script running locally, to read files on the user's PC. WebLoadFile provides a solution in such cases. Possible uses of WebLoadFile:
|
|
WebLoadFile demo
Back to top The server on which this page is placed is named "Demo". The applet is placed in this folder. Thus, it is allowed to read it as well as the subfolders. The applet automatically takes the color of the HTML background. This is why you cannot see it. It is sized to 1x1 pixel. This page contains 4 instances of the same applet, with different parameters, for demo purposes. The first applet is here --> , another one is here --> , the third one is here --> , and the fourth one is here --> Here is the structure of files and directories:
Note that:
And now to the demo itself: |
|
More details about WebLoadFile
Back to top What is WebLoadFile? WebLoadFile reads files from a webserver or from a local computer. OK, but why is it special? Client-side JavaScript has some limitations. For example, it is impossible to access the server to load files other than .JS files. Usually, the way to solve this problem involves some CGI working on the server, reading the files there and then building some HTML files "on the fly" with the file's content. In some cases, however, this solution is not possible (CGI are not be allowed on some servers, for example). Plus, programming CGIs requires some knowledge in this field, something that not everyone can afford or is interested to learn. So what do you propose? Is it secure? WebLoadFile provides a solution. The Java applet is allowed to read files from the server it is on. There are, however, no security problems, thanx to the concept of "Sandbox", which is part of the language Java, and which allows the applet to only read files on its own server, and only in the directory in which it is placed (and of course subdirectories of this one). First, the applet can load a listing of all files in the directories. Then, the applet provides the content of the chosen file to JavaScript for display or to work with it. Any other use? What about local files? Another interesting case is when a programmer knows JavaScript, but doesn't know Java or C++ or another language allowing local file access. The programmer may want to load files to work with, however. With WebLoadFile, the programmer can use a browser and JavaScript to make a GUI (Graphical user interface) very easily, and leave the complex part of loading the file to the applet. Check if a file exists WebLoadFile V1.3 now offers a method to check if a file exists or not. The method "fileExists( String strFileName )" returns true if the file exists and can be opened, and false if not. It can be easily called from JavaScript to check the existence of a file on the server, or, if the applet runs locally, on the user's PC. Is it easy to use? A lot of people like to program JavaScript, because it doesn't need a special development environment, can be executed on browsers (present on every computer for free), and allows to build GUIs (Graphical user interface) at low development costs. The applet does nothing but load the files. The rest is done in JavaScript and thus is very easy to adapt to every user's need! What browsers does it work on? WebLoadFile has been thoroughfully tested on Netscape 4.7, Netscape 7.0 and Microsoft Internet Explorer 5.0 on Windows NT, Windows 95, Windows 98, Windows 2000. It will work on any version of Netscape 4.0 and above, and IE 4.0 and above. It will work properly on any browser supporting Java, JavaScript and the interaction between them (named LiveConnect). Note: IE for Macintosh is reported to have many problems with LiveConnect. It is possible that WebLoadFile doesn't work properly on IE for Macintosh. Any known problems? Some webservers disallow the loading of the directory listing. In this case, loading a specific file will still be possible, but not the file list. Back to top or to provide the user with a list of all files in a directory. It can be used to display and work with the content of ASCII (text) files or binary files. Interested? |