Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to implement file downloading functionality ?

 
Ritesh Badwaik
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am developing a web application which provides very large data files(file size is equal to about 500 MB) for downloading.
Can anyone tell me, how to implement this ?
Also I want to know , what is FTP file downloading & HTTP file downloading ? Which one I should use ?




Regards
Ritesh
 
Tim McGuire
Ranch Hand
Posts: 820
IntelliJ IDE Tomcat Server VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
a few questions.
Are the files compressed already?
How much traffic are you expecting?
Have you looked into Amazon S3?

You will want to avoid loading the entire file into memory and then trying to send it. Instead, use streams.


This is a good thread about using streams for downloading large files. link

With FTP you will need a separate program on your sever, an FTP server. Your users will need an FTP client.
HTTP downloads allows your web server to do the job.

also read this post on handling large data files
 
Ritesh Badwaik
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thanks for the reply.
The files are already compressed.
Can you please explain me how to implement HTTP downloads using java ?
Does it require any program to be installed like FTP ?



Regards
Ritesh
 
Tim McGuire
Ranch Hand
Posts: 820
IntelliJ IDE Tomcat Server VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK you have a servlet. and you have a file called huge.txt:


I adapted this from http://snippets.dzone.com/posts/show/4629
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic