tags:

views:

33

answers:

3

Hi,

I need to save the files which are coming from the server automatically in the client side. The file comes to the client side to download. At that time I want to save the file automatically without user interaction. Is there any way to do this ?

+1  A: 

To answer your question, no. Browsers won't allow it, unless a user chooses to upload. But even if there is a way, i would advise against using it.

Babiker
+2  A: 

Even if you can do this by any means its HIGHLY NOT RECOMMENDED

This will be a huge security threat and it won't be allowed. Javascript is inside a security sandbox and won't allow these kind of things.

What if the server is sending a potentially dangerous file that might affect the client system?

See JavaScript security

rahul
A: 

At best, you could display the file download prompt. The browser's security (and common sense :)) won't allow you to do anything more. If you absolutely must do unsupervised file downloads, you could use some kind of ActiveX, or a Java applet.

SWeko