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

I have a Document Library with some exported webparts (.dwp). When I embed a hyperlink somewhere to the document, it opens in the browser (IE8). I cannot change any settings on the site collection neither can I change the defaults for anything regarding the farm or filesystem. The solution has to apply for this library only.

Basically I need a link which engages the same behavior like the "Download a Copy" Button in the library.

share|improve this question

1 Answer 1

up vote 5 down vote accepted

The link can be reproduced using the following link, where "Documents" is the name of the library:

    http://spsite/_layouts/download.aspx?SourceUrl=http://spsite/Documents/sample.docx

Effectively the download.aspx will read the content of the file you send as the SourceUrl, and render it back to you on the HTTP response.

Hope that helps

share|improve this answer
    
Works like a charm, thanks a lot! :) Just for completeness, could you add an "?" behind the default.aspx? –  curmudgeon Oct 11 '12 at 15:40

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.