SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 15 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
    
James would there be a way to tell SharePoint to add the link just like that on a publishing page for documents, or do we have to manually re-type our anchor links to look like this? – blachawk Jan 14 at 14:31

I was trying James' solution but was having problems building the correct URL of the document. To get the URL you can:

  1. Open Dev Tools (F12)
  2. Open the Network tab
  3. Click the download a copy button for the document you want the link for
  4. The HTTP GET request URL will appear in the network tab.
share|improve this answer

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.