Click here to Skip to main content
16,020,877 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi coders,
I have a module to upload the documets(pdf/word) in to database which is working fine.My next step is i want to send those documents in an email as an hyperlink so that when a user clicks on the link it opens up the corresponding document in read only mode.How can i pass documents saved in database to the email function in asp.net and make those documents open in seperate window in read only mode.Any help would really be appreciated.

Regards,
Gourav Sharma
Posted

1 solution

Hello Gaurav,


Assuming that the documents are not of critical nature and security is not really a big concern then, you can develop a handler in .NET to accomplish this. The handler will receive a simple parameter say document id as part of query string. The handler will then retrieve the document corresponding to this id and will stream it back to end user. Please have a look at this[^] article, it should you get started. I guess you already have figured out how to create a link and send it via e-mail.

Regards,
 
Share this answer
 
Comments
Gourav Sharma from Jammu 14-Sep-13 15:02pm    
I want to work with pdf's and word files only.Moreover i want the files to open in read only mode so that user should not be able to copy or print or save the contents of the file.Please provide the solution for the same.
Prasad Khandekar 15-Sep-13 15:01pm    
There is nothing like readonly mode once the file gets on to user's pc. From server side you will be streaming the binary data with appropriate content type header letting browser know what type of file it is. Browser will then user suitable program to open it. The user can actually save the document via that particular program, If you really want the readonly behavior then you can have a look at following links. These are commercial products though.

http://www.textcontrol.com/en_US/sites/asp-dotnet-word-processor/?gclid=CKW5rpyLzrkCFYwF4godEiQAlQ
http://www.radpdf.com/features/
http://flexpaper.devaldi.com/ (Open SOurce)

Regards,

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900