This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes code to download file on clientside at Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "code to download file on clientside at "c:\Temp" folder" Watch "code to download file on clientside at "c:\Temp" folder" New topic
Author

code to download file on clientside at "c:\Temp" folder

avinash katore
Greenhorn

Joined: Jun 30, 2010
Posts: 2
I want a code to download a file on clientside at "c:\Temp" folder.
I have a code but problem is whenever I download a file it shows download dialogue box and ask where to save .
I dont want that dialog box.
I want a code which directly store my file at "c:\Temp" folder.
please help me!!!



thanks in advance
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41064
    
  43
Can't be done. The web app has no control over what the client (the browser) does with the download, and that's a good thing.

If you're just concerned with your own browser, then you can set its download directory to "c:\temp", and instruct it to store all downloads there directly without asking. But other people's browsers are beyond the web app's control.


Ping & DNS - my free Android networking tools app
Rahul Nair
Ranch Hand

Joined: Dec 01, 2007
Posts: 138
Hi,

When we click to download the file, We will get the dialogue box asking for either open a file or location to save the file. My question is that, Is it possible to do: when user clicks on a file, the file should open within the browser instead of showing us the dialogue box.

Thanks,

Rahul
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41064
    
  43
That's up to the user to decide. That dialog generally has a little checkbox saying something like "always open files of this type" or some such. If the user checks it, then that's what will happen from then on. But there's nothing the web app can do to cause that.
Rahul Nair
Ranch Hand

Joined: Dec 01, 2007
Posts: 138

Thanks for reply.

In my case when i download files, it ask each and every time when i clicks. I am always using Mozilla browser for this. I think there is some response parameter to set for viewing instead of downloading... because i have read that somewhere but now, i did not remember it.

Thanks

Rahul
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41064
    
  43
I think there is some response parameter to set for viewing instead of downloading...

There isn't. In the Firefox Options dialog, check the "General" tab - it has the options related to downloading files.
Rahul Nair
Ranch Hand

Joined: Dec 01, 2007
Posts: 138
Ok, thanks for your reply.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: code to download file on clientside at "c:\Temp" folder
 
Similar Threads
how to save the file in clint side in temp folder
how to change webstart's default download folder?
Comparing array elements between 2 different arrays
Serializing/ Importing Packages/Classpath issues
downloading the file