logo
search
SharePoint Document Issues

How to Force a SharePoint File to Download Instead of Open

Huda QurayshiHuda Qurayshi Sep 25, 2026 868 views

Question details

How to create a direct link that forces a SharePoint file to download to the user's computer rather than opening in the web browser.

How to Force a SharePoint File to Download Instead of Open
Product
SharePoint
Device & OS
not provided
Scenario
A user wants to provide a 'Download Form' link on a SharePoint site for an Excel file, but standard links open the file in Excel for the Web, and hardcoded links break when the file is renamed.
Observed behavior
Clicking the SharePoint file link opens the document in the browser by default. Alternatively, using an HTML download link stops working if the file's name in the library is modified.
Before you start

Verify your SharePoint site URL and ensure you have Site Member or Owner permissions to modify web parts or apply column formatting in your document library.

Solution 1Recommended

Use the SharePoint Download Endpoint for Static Links

Force the file to download instantly by prepending the built-in SharePoint download URL to your file link.

This approach utilizes SharePoint's native download page. It is best suited for files whose names are permanent and unlikely to change, ensuring users get a direct download prompt instead of opening the file in Excel for the web.

1
Copy your file's direct link

Navigate to your SharePoint document library, locate the file (such as your Excel form), and copy its direct URL path.

2
Construct the forced download link

Open a text editor and paste the base download endpoint for your site: https://yourtenant.sharepoint.com/sites/yoursite/_layouts/download.aspx?SourceUrl=. Immediately following the equals sign, paste the direct file URL you copied in the previous step.

3
Embed the link in your site

Insert the newly constructed URL into your Script Editor web part or hyperlink text (e.g., <a href="your_constructed_url">Download Form</a>). When clicked, the file will automatically download.

Use the SharePoint Download Endpoint for Static Links
Free Microsoft Office alternative

View and Edit Downloaded Excel Forms with WPS Office

Once you have successfully downloaded your SharePoint Excel files, you can quickly open, edit, and analyze them using WPS Office. It provides a lightweight, highly compatible, and free alternative to Microsoft Office, keeping your productivity high without the premium cost.

  1. 1. Launch WPS Office: Open the WPS Office application on your computer after downloading your file from SharePoint.
  2. 2. Open the downloaded file: Click 'Open' on the home screen and navigate to your computer's 'Downloads' folder.
  3. 3. Start editing: Select the downloaded Excel form to open it instantly. You can now edit the document and save it locally.
Seamlessly open and edit Excel (.xlsx) forms downloaded directly from your SharePoint environment.Highly compatible with all Microsoft Office file formats, ensuring zero formatting loss.Lightweight application with incredibly fast loading times on any operating system.Familiar ribbon interface allows for an instant and effortless migration from MS Office.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my SharePoint file open in the browser instead of downloading?

By default, SharePoint is configured to open Office documents (like Word, Excel, and PowerPoint) in their respective web applications (e.g., Excel for the Web) to facilitate quick viewing and co-authoring. You must explicitly use the download.aspx endpoint to override this default behavior.

Will this download method work for non-Office files like PDFs?

Yes, utilizing the _layouts/download.aspx endpoint works for forcing the download of almost all file types stored in a SharePoint library, including PDFs, images, and text files.

How do I fix the download link if I rename the SharePoint file?

If you are using a static download link, you must manually edit the URL and update the SourceUrl parameter to reflect the new file name. To avoid this manual update, it is recommended to use dynamic SharePoint column formatting with the [$FileRef] parameter.