Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Download document or image to server  RSS feed

 
Angela D'souza
Ranch Hand
Posts: 469
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I know about uploading document for on client side using enctype="multipart/form-data you can display browser button & using http post submit method you can upload document.
How can I download document or image file from server to user desktop using servlet or jsp or java classes?
Thanks,
Angela
 
amit mohanty
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, to download any file from server u give a hyper link to that particaular file.
For example u want to give a link file name x.pdf which is availabel in <server root directory>/file/download.
In ur HTML/JSP page write
<a href="http://<hostname>/file/download/x.pdf>
download x.pdf</a>
Instead of downloading if u want to show it in brouser u have to set mime type in JSP/SErvlet program.
If u hacve any more doubt on this, let me know.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!