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.

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

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

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

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?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.