File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Avoid Dialog box when downloading a file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Avoid Dialog box when downloading a file" Watch "Avoid Dialog box when downloading a file" New topic
Author

Avoid Dialog box when downloading a file

deep menghani
Greenhorn

Joined: Oct 07, 2010
Posts: 7
Hi,

Query :

When we export data in a file through java code , is there any way to avoid that pop up which asks for OPEN / SAVE / CANCEL .
Example : I have a link .If I click the link the file should be directly saved on to the mentioned disk location without the pop up.

Is there any way to do this??

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61413
    
  67

There is not. And thank goodness! Imagine the security nightmare if any old web site could write to your file system!


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
deep menghani
Greenhorn

Joined: Oct 07, 2010
Posts: 7
Agreed..

but since we have source and destination folder information in our application , can there be any way to copy those files from source to destination.?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61413
    
  67

Are you talking about a client machine that you have credentials for, or any random client?
deep menghani
Greenhorn

Joined: Oct 07, 2010
Posts: 7
yes a specific client machine.
i know the destination folder where in the file should go..
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61413
    
  67

Do you have login credentials?
deep menghani
Greenhorn

Joined: Oct 07, 2010
Posts: 7
Sorry ..there is no specific client..

it would be different for each user...but the source folder is common .
i.e.

if the link is clicked..the file from source folder should be copied on to client machine..
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61413
    
  67

Then, no. If you understand about the security problems, then you know this is untenable. You are either going to have to live with the dialog, or use some other means (such as a trusted applet).
deep menghani
Greenhorn

Joined: Oct 07, 2010
Posts: 7
ohh..thank you Bear for your replies..

If you kno of anything I can do to copy the files thru a link please let me know..

thanks again...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Avoid Dialog box when downloading a file