I have been tasked with moving some HTML utilities from a Windows system to Linux. Everything went well except for Javascript that makes use of ActiveXObjects. Specifically, one of the HTML pages had a form that, when the user hit submit, did some processing and saved a text file on the local file system where the html file was stored. Obviously, I don't have ActiveXObjects in Firefox. I attempted to use an XMLHttpRequest to send my data to a Perl or PHP script that could save a file like so:
var xhr = new XMLHttpRequest();
xhr.open("POST","myScript.[php/pl]",true);
xhr.send(myData);
But that did not work. In my Firefox error console, I got the error "not well-formed" with an arrow pointing at the first character of the first line of my perl or php script (I tried both). Obviously, Firefox was able to access my scripts because I could see them, but not execute them. I'm guessing this is a security issue. The html page and the script are stored at the same file:// location.
I need to get around the security or change how the save is implemented. It can be saved on the users machine or the file system, and mandatory user interaction is OK. Any suggestions?
A couple of notes:
- This must work with a Linux file System and Firefox
- I can't make use of any extra utilities or libraries
- The system in question is a closed network so "less than secure" fixes will work.
Thanks in advance!

New Topic/Question
Reply


MultiQuote




|