Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Am looking to design a web part that will display a link for a user to download a PDF file. This is stored as a BLOB in SQL Server. This web part would be connected to another Sharepoint list where the user selects an item and this web part would display a link to view/download the file(s) if there are any.

Running Sharepoint Foundation 2010. Is there any way to do this? I am a novice at developing anything for Sharepoint (just created my first web part all by myself!) and would appreciate any assistance.

Thank you.

Joe

share|improve this question
add comment

1 Answer 1

So the problem here is that a blob in SQL Server is not hyper-linkable. Your web part can generate a link, but what would the link point to - it has to be a resource a Web Server can actually address.

To solve this problem, you need need an intermediary between the hyperlink and the SQL Blog. Example - your web part provides a hyper-link to a custom page that takes a query parameter with the unique ID of the blog in SQL, and the custom page queries SQL Server and renders out the data with the correct HTTP headers so the browser thinks its a file.

I have seem similar requests for this in the past, but I have not come across a code sample.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.