Hi All

In my application attachments will store as BLOB in the database, when a person receive the mail how to view the attachment with out download it just like yahoo mail there are 2 links 1) View Attachment , 2) Download Attachment, i want similar functionality please some body help me in this regard, can some one send code for this functionality any help greatly appreciated.


Regards
Prasanna

The attachments for yahoo might be in a database, but the user that sent the attachment isn't going to be sending a link to access the attachment from there database. The attachment is just part of the email message itself. With Yahoo doing one particular way of allowing a user to access that attachment.

Are you creating a web based email system and want to imitate the yahoo functionality and they attachment object you're working with is stored in the database already for you? Or what exactly are you trying to do. Please be specific.

You might need a little more then just a jsp to do this functionality btw...

Regards,

Nate

Hi Nate

Thanks for reply ,it is not exatly a full mail system it is a intranet Medical project where users will ask for some calrification in feedback form by attaching bills as attachments , then the person who is responsible to answer will go thru mail and view the attachment , we need to perovide 2 facilities 1) he can view 2) he can save to disk , these attachments are stored in data base as blobs ,along with mail we will display 2 links, when he click on first one he wants to view it online ,second one then ha can save to disk, this attachments can be .doc or .pdf , could please provide me some peace of code how to view attachments online which are stored in database


Regards,
Prasanna

Well, actually the viewing the attachment with the web browser should be fairly easy. The browser will need to have some different plug-ins installed like adobe reader and ms office (Browsers might just open the products on their own, you'll just have to test.). Then when the user clicks on that link your servlet or action will have to return the document in each files mime type. (image/jpg, image/gif, are examples of mime type).

Then to get the user to download the file...that one seems a little more difficult to me. You might be able to intruct the user to right click on the link and then chose save as. Or there might be a javascript solution that when a link is click forces the save as dialog box to appear.

Regards,

Nate

Hi

Thanks for replay, sure i will try out this.

Thanks & Regards
Prasanna

plz someone give tell me how to download attachment using jsp

plz someone give tell me how to download attachment using jsp

Hi and welcome to the Daniweb forums :).

==========

Maybe you should start your own thread instead of posting in one that is three and a half years old :).
I am sure you will get the answer you need then.

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.