Jump to content
  • Advertisement
Sign in to follow this  
Lucidquiet

[web] File IO with Firefox ?

This topic is 4208 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello: This maybe newbie question, but I would like to read in a flat text file form FireFox in order to run a test based on the content of that text file. Is there a simple example of doing this some once can provide? Also, I will need to write out the results of running the test, which I would suspect would be available along the same lines as well. Help appreciated, thanks, L-

Share this post


Link to post
Share on other sites
Advertisement
That's not a lot of info so I'm assuming the basics here...

You need this to run server-side (at the Internet provider or run a local web server). Understanding the basics of CGI (Common Gateway Interface) is a good start if you don't already. Find out what your Internet provider supports such as PHP, Perl, ASP, ASP.NET, etc. Local file IO straight from the browser through javascript just isn't possible due to security issues. You could use the HTTPRequest object through ActiveX if you're using XML but it would still have to be server-side if you wanted to write to it.

Once you know what server-side language you are using, let us know and I'm sure we could be of more help.

Share this post


Link to post
Share on other sites
You can't read local files from javascript in unprivileged code in Mozilla.

If you are writing some privileged javascript code (e.g. an extension or something), then it is possible to read/write files, using something like:


var file = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
file.initWithPath("/tmp/test.txt");


But you probably won't want to do this.

Mark

Share this post


Link to post
Share on other sites
thanks coderx75
i hawe similar problems with ie.
request object gives error...">>ACCESS DENIED<<" on ie...?
when i try to get content...

on all pages which are public...
i cannot understand whay...
they are public...

can you help me...?

Share this post


Link to post
Share on other sites
You cannot request files across domains. Even requesting a file on www.example.com from a site being viewed at example.com will not work! You must request files from the same domain that the javascript source code is running from!

Share this post


Link to post
Share on other sites
isnt it possible with childs or any other way on html.
i do not using firefox but it isnt important.

also sory about asking on your topic.. Lucidquiet ...
...
also is firefox realy open source...
like open source c...?
generally i can't found any open source which is open source...?

[Edited by - RSC_x on June 23, 2007 6:33:18 AM]

Share this post


Link to post
Share on other sites
Yes, Firefox is open source. Please ask questions unrelated to this topic in a separate thread.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!