[Javascript] I want to write to a file using JavaScript

Richard Lewis richardlewis at fastmail.co.uk
Tue Mar 15 04:16:45 CST 2005


On Tue, 15 Mar 2005 12:03:18 +0530, "Poonam Pandey"
<poonamdp3 at gmail.com> said:
> Thanks a lot.
> But if we want to write to a file using Javascript 
> is there any workaround for this?
> 
> 
Not with standard JavaScript. If you think about it, you may have very
good intentions for whatever website you're working on, but just imagine
if anyone in the world could write a page that is allowed to access
files on your computer - JavaScript viruses! Not a pretty thought.

If you're working in-house and you can rely on all your clients having
ActiveX (i.e. MSIE 6 running on MS Windows) then you can make use of the
facilities it offers, but they won't work on other browsers.

For Microsoft-only solutions, check out:
http://www.webreference.com/js/column71/

> On Fri, 11 Mar 2005 14:56:06 +0000, Richard Lewis
> <richardlewis at fastmail.co.uk> wrote:
> > 
> > On Fri, 11 Mar 2005 20:06:44 +0530, "Poonam Pandey"
> > <poonamdp3 at gmail.com> said:
> > > Hi,
> > >  I want to write to a file using Javascript
> > In short, you can't do this with client-side JavaScript because its
> > insecure.
> > 
> > > but when i use
> > > ActiveXObject it shows the warning "An ActiveX Cotrol on this page is
> > > trying to interact with other parts of the application.It may be
> > > unsafe to doso.Do you want to allow this interaction?"
> > > And also i tried disabling the ActiveX options in the Internet
> > > properties -options but it doesnt take up these settings.
> > > Mine is a windows service pack4
> > >
> > (Note that ActiveX allows communication around the MS Windows "operating
> > system" only; check out MS's support pages)
> > 
> > > Then in read that we can use File Object to write to a file but even
> > > this is not working as it is giving some errors as File object is not
> > > recognised.
> > >
> > There is no File class in standard JavaScript.
> > 
> > > How can i use that File object in my JavaScript file?And after using
> > > this File object does this JavaScript becomes a Server Side
> > > JavaScript?
> > >
> > You can use server-side JavaScript with the correct server software. The
> > main environment for running server-side JavaScript is Microsoft's ASP.
> > You can't run server-side JavaScript within a browser (this is
> > client-side); client-side JavaScript can never magically become
> > server-side JavaScript.
> > 
> > Richard.
> > _______________________________________________
> > Javascript mailing list
> > Javascript at LaTech.edu
> > https://lists.LaTech.edu/mailman/listinfo/javascript
> >
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript



More information about the Javascript mailing list