954,574 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Client side downloading code

Hi. I am developing an e-mail application for lab works. I am using servlets mainly along with JSP and using HTML with CSS. I have two questions.Please tell me the solutions. Its important and its urgent.
1. As usual I give the provision for attachments.I wrote code for uploading files for attachment and it works. I dont know how to download the file when the client needs it from the server. Please help me.Its urgent.If code is offered it would be great.
2.I have used servlets for some pages. In these pages the CSS file is not gettng accepted. The format, image is not getting displayed. I dont know what to do. Please help.

rlaknar
Newbie Poster
14 posts since Feb 2009
Reputation Points: 10
Solved Threads: 0
 
hi friend for downloading the files on your server Give the full path of the file in the Jsp page which will locate on the server
<a href="www.yourserver.com/java/chapter.txt" >Download file</a>
if you want to download the file in the zip format then you must upload the file in the zip format then the path will be
<a href="www.yourserver.com/java/chapter.zip" >Download file</a>
remember the
<a href="dynamic value get from servlet through bean getter method ">
you must set the path of the file in bean setter property
amarjeetsingh
Newbie Poster
21 posts since Feb 2009
Reputation Points: 2
Solved Threads: 1
 

Thanks for your reply.I have another question. How can I make the downloading file to save on the client's disk? Please help!

rlaknar
Newbie Poster
14 posts since Feb 2009
Reputation Points: 10
Solved Threads: 0
 

my dear frnd
i gave the answere of your question
Please read it carefully
when the client click the link
download file, it automatically ask from the client
do you want to save it
if client click the YES
then after browsing ,client save the file
where he desire

amarjeetsingh
Newbie Poster
21 posts since Feb 2009
Reputation Points: 2
Solved Threads: 1
 

Sire, I have tried for zip file, its working as you said, i when i tried for txt file browser displays the content directly. For this what i should do?

rlaknar
Newbie Poster
14 posts since Feb 2009
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You