-
Loading a textfile into a textarea on server
Hello!
I have abit of a problem, which is:
I'm using a textarea inbedded into an html page, which allows users to load in text files, mainly HTML into that textarea, which is then converted and the user can save the file to their desktop.
At the moment, I'm using the following code:
function readFile (fileName) {
if (document.layers && navigator.javaEnabled()) {
netscape.security.PrivilegeManager.enablePrivilege('UniversalFileRead');
var bfr = new java.io.BufferedReader(new java.io.FileReader(fileName));
var line;
var content = '';
while ((line = bfr.readLine()) != null)
content += line + java.lang.System.getProperty('line.separator');
return content;
}
else if (document.all) {
var fso = new ActiveXObject('Scripting.FileSystemObject');
var fs = fso.OpenTextFile(fileName);
var result = fs.ReadAll();
return result;
}
}
This function uses an activeX control to load in the file.
I want to run the html page on a server, and still allow the user to be able to load a text file into the textarea.
However, I'm aware the above code won't work for this?
Can someone suggest a method by which I can? Unfortunatly the server I'm uploading to is not mine and I doubt the security settings can be changed because its on a very large network..
Thanks for any help in advance!
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks