How to Force Download SharePoint Image and Text Files by URL
Question details
The user is trying to use the ?download=1 URL parameter to force the download of files from SharePoint for browser-based automation, but it does not work for image and text files.

- Product
- Microsoft SharePoint / OneDrive
- Device & OS
- not provided
- Scenario
- Setting up browser-based automation that relies exclusively on manipulating SharePoint file URLs to retrieve documents.
- Observed behavior
- While the parameter successfully downloads DOCX and CSV documents, it causes image files to open directly in the browser and appears to have no effect on text files.
Verify that your SharePoint or OneDrive sharing permissions are correctly configured to allow file downloads before attempting to automate the process.
Seek Custom Code Workarounds via Microsoft Q&A
Since native SharePoint URL parameters cannot force image and text downloads, utilizing custom development methods like the Microsoft Graph API is required.
Currently, there is no supported, built-in way to force image and text file downloads using only the SharePoint URL appended with the ?download=1 parameter. Modern web browsers natively render web-safe files like PNGs and TXTs, overriding the download parameter.
This limitation applies to both Microsoft SharePoint and Microsoft OneDrive environments. To achieve automated downloads for these specific file types, you will need to implement a customized code solution.
Determine if your current browser-based automation setup can support REST API calls or external scripts (such as Python or PowerShell).
Navigate to the Microsoft Q&A platform and access the 'SharePoint Development' or 'Office SP Development' tags.
Post your specific automation requirements to community members and Microsoft engineers, asking how to use the Microsoft Graph API or Power Automate to programmatically fetch the file contents instead of relying on URL parameters.

Switch to WPS Office for Seamless Document Management
If you are encountering limitations with Microsoft SharePoint or OneDrive file handling, consider switching to WPS Office. It provides a lightweight, highly compatible alternative for creating, editing, and managing your documents without the complex enterprise overhead.
- 1. Download the Installer: Visit the official WPS Office website and download the free version for your operating system.
- 2. Install WPS Office: Run the setup file and follow the quick installation prompts to set up your new office suite.
- 3. Manage Documents Easily: Open your existing DOCX, CSV, and text files directly in WPS Office to enjoy seamless editing and reliable format retention.

Frequently Asked Questions
Why does the ?download=1 parameter work for DOCX but not for PNG or TXT files?
Modern web browsers are designed to natively render certain web-safe file types, such as images (PNG, JPG) and plain text (TXT). The browser prioritizes displaying these formats inline over the SharePoint download parameter, whereas formats like DOCX or CSV require external applications and thus trigger a download.
Does the ?download=1 URL limitation also affect OneDrive files?
Yes. Because OneDrive shares the same underlying architecture as SharePoint, appending the ?download=1 parameter to a OneDrive URL will exhibit the exact same behavior—opening images and text files in the browser instead of forcing a download.
What is the best alternative for automating file downloads from SharePoint?
Instead of manipulating browser URLs, the most reliable method for automating SharePoint file downloads is to use the Microsoft Graph API, which allows you to programmatically authenticate and request the direct file streams regardless of the file extension.




