This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Write file to client file system Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Write file to client file system" Watch "Write file to client file system" New topic

Write file to client file system

Aidan hughes

Joined: Dec 14, 2006
Posts: 10
Hi all,

I need to write a file to the client PC. I know javascript / html doen't usually have rights to do this, but I'm working on my company's intranet and in the IE trusted zone so I can use ActiveX components such as the FileSystemObject. I just can't get this working yet.

The file I'm copying is stored in a database and I usually access it to display it on a web page using a servlet (delivers it through a buffered output stream). I'm trying to do something like this:

fso = new ActiveXObject("Scripting.FileSystemObject");
fso.CopyFile("http://serv:8080/app/getPic?PicID=46", "c:\\file.jpg");

The error I'm getting is "path not found" - I can only assume the fso can't access a URL to get a file.

Am I on the right track or am I barking up the wrong tree?
Any ideas anyone??

Thanks in advance,


I agree. Here's the link:
subject: Write file to client file system
It's not a secret anymore!