• Post Reply Bookmark Topic Watch Topic
  • New Topic

Big binary file interactive downloading

 
Vlad Gurevich
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let say we have WEB application, which creates the temporary file and user should be able to download this file on his machine (if he wishes to do it).

File can have a huge size (for example, 200MB), contains binary data and have unknown type (no extension at all or unknown extension). So the user should not be allowed to open file in the Browser, but only download it on his hard drive. There are different possible solutions and all of them have some problems:

1) Display link to this file: <a href="file name">Download file</a>
It works, but sometimes the system automatically begins to download a context of the file on the page -- We don't want it
Sometimes the system displays the dialog box " File downloading" with "OPEN", "SAVE", "CANCEL" and "MORE" buttons -- Again we don't want to show "OPEN" option to user

2) Use context-menu: option "Save Target AS"
But context menu contains again "OPEN" option-- we don't want to show this option to user

3) Use force-download feature
In this case the page contains the link to jsp, which actually activates this feature, such as:
<a href="myForceDownload.jsp?filename=file name></a>

This jsp sets the specific context type in the response:
response.setContentType("application/force-download");
and write the file in the output stream. The system displays the dialog box, which is includes only "SAVE","CANCEL" options -- It is good
But the problems are here:
Downloading can take a lot of time, but there are no any progress messages or, at least, some warning message.
Sometimes nothing happens except "Done" message in the Browser status bar, but no file has been downloaded
The worsens things are that we have no control (or at least visualization) of this process.

Any idea how this kind of task can be solved better?

Thanks in advance for any response on this message
 
David Bridgewater
author
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vlad...

I would go for a trusted applet embedded in the JSP page.

Whether or not this is a good approach for you depends a bit on your user base (will they get along OK with applets? Will they have an up-to-date plug-in their browser?).

But at least with an applet you can avoid altogther the Open/Save/Cancel dialog normally presented by your browser.

HTH -

David.
 
Vlad Gurevich
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David,

It is a good idea to use applet, but I am not sure about user base to run applets and I am still looking for some solution within standard Browser tools and force-download feature

Thank you very much
Vlad
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!