2

Force downloading the word documents stored in SharePoint when the user clicks on the link (using "Quick Links" webpart) is not working as expected.

To successfully download the file, the link required to be clicked twice!!.

I've added the links in "Quick Links" webpart in the below format

https://TenantName.sharepoint.com/:w:/s/SiteCollectionName/EV8bwK_6d9hKou_RVS7GFXcBlMWrv5nZpViNQmUHtwarJA?e=3RPjsi&download=1

enter image description here

The query string parameter &download=1 is used to force download the document as I don't want them to be opened in Word Online.

quick links setup

When I click on my Quick Links, it takes 2 clicks to trigger the download. On the first click, the browsers address bar updates but nothing is downloaded. The second click works. (Please test it by adding multiple links of different files to the webpart, as it is working correctly during the first link click but misbehaving for the subsequent file download links)

Using a Text Web Part and simple hyperlinks works fine, but doesn't look as good.

Has anyone been able to one click download SharePoint Hosted Word documents using quick links?

2

2 Answers 2

2
+50

You can't out-of-the-box:

The Quick Links web part does NOT allow for one-click download functionality.

It seems that SharePoint handles tenant-based download links differently than out-of-tenant links.

Ex, you can have multiple out-of-tenant based links in Quick Links and one click will always trigger the action of the link. However, if you use tenant-based download links with &download=1 or download.aspx, you need to double-click the link to trigger the download.

Workaround:

  1. Instead of using &download=1, you can build a download link by utilizing the download.aspx page with a UniqueId parameter:

Get the UniqueId for your target file by opening the file in Word Online (through SharePoint). The URL of the page should look like this:

https://yourtenant.sharepoint.com/:w:/r/sites/yoursite/_layouts/15/Doc.aspx?sourcedoc=%7B91EA3429-A536-4894-B3D9-FAB385EDC188%7D&file=Test-File-1.docx&action=default&mobileredirect=true 



Extract the sourcedoc query string without the leading %7B and without the trailing %7D: 91EA3429-A536-4894-B3D9-FAB385EDC188


Now you can build the download link:

https://yourtenant.sharepoint.com/sites/yoursite/_layouts/15/download.aspx?UniqueId={91EA3429-A536-4894-B3D9-FAB385EDC188}

  1. Use a site like bitly.com to generate an out-of-tenant redirect/shortened link:

Bit.ly generating a short link redirect

Add the redirect/shortened link to your Quick Links web part: A GIF of the Quick Links web part be able to download files with one click!

5
  • @dan-walters, ^ is this what you were hoping for? @ Commented May 18, 2022 at 18:29
  • Could you please try it with multiple document links? Commented May 19, 2022 at 13:09
  • @TerminalVelocity yes, but does this work with multiple different document links. Add documents to Link2 and Link3, then this will fail. Commented May 19, 2022 at 14:45
  • @DanWalters I have updated my answer to include a workaround for multiple document links! Check it out! Commented May 20, 2022 at 13:38
  • 1
    @TerminalVelocity thanks for the workaround. as of today, bitly free account allows unlimited clicks for 50 links, which is enough for my application. bounty awarded Commented May 23, 2022 at 13:15
0

Your link can be in the following format for it to be easily downloaded in one click.

https://yourtenant.sharepoint.com/sites/yoursite/Document-Library/Folder/File-Name.docx

To easily get the url in this format, you may open the file in Desktop App:

  1. On SharePoint, right-click file name
  2. Open > Open in app
  3. File > Info > Copy Path
  4. Remove the "?web=1" at the end of the link
  5. Use this link the the Quick Links part
2
  • thanks, but I already have links hat download in one click. This format doesn't help. It is the web-part that i'm having trouble with. Commented May 18, 2022 at 10:53
  • additionally, the quick link web-part will append the web view parameter to this link type anyway. Commented May 18, 2022 at 15:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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