logo
search
OneDrive File Issues

How to Create OneDrive Download Links That Preserve File Names

Huma Ashraf ChHuma Ashraf Ch Oct 9, 2026 870 views

Question details

The user needs to generate OneDrive download links that maintain the original file paths and names, allowing an HLS video player to correctly locate M3U8 playlists and accompanying TS media segments.

How to Create OneDrive Download Links That Preserve File Names
Product
OneDrive
Device & OS
not provided
Scenario
Hosting and delivering streaming media files (HLS/M3U8) via cloud storage.
Observed behavior
OneDrive generates download URLs utilizing unique file IDs instead of standard Amazon S3-style folder paths, which breaks the relative path dependencies required by HLS players to locate media segments.
Before you start

Keep in mind that OneDrive is primarily designed for document collaboration and storage rather than functioning as a dedicated Content Delivery Network (CDN) for streaming media playback.

Solution 1Recommended

Use the SourceUrl Parameter for Path-Based Links

Create a force-download URL that explicitly references the file's exact hierarchical path instead of its unique ID.

While OneDrive does not support custom path routing identically to Amazon S3 natively, you can bypass the unique ID system by utilizing the SourceUrl parameter. This method forces the server to locate the file via its folder path.

1
Locate File Details

Log in to OneDrive for the Web. Note your tenant name, user account name, and the exact path of the target file.

2
Construct the Download URL

Format your URL as follows: https://<tenantname>-my.sharepoint.com/personal/<useraccount>/_layouts/15/download.aspx?SourceUrl=<filepathURL>

3
Test the Link

Paste the constructed URL into an incognito browser window to verify that it successfully triggers the download based on the file path.

Use the SourceUrl Parameter for Path-Based Links
Path Encoding: Ensure that the <filepathURL> string is properly URL-encoded (e.g., replacing spaces with %20) to prevent broken links.
Free Microsoft Office alternative

Looking for a Lightweight Microsoft Office Alternative?

If you frequently manage complex documents and are exploring alternatives to the Microsoft 365 ecosystem, WPS Office provides a free, fast, and feature-rich solution for all your daily productivity needs.

  1. 1. Download the Installer: Visit the official WPS Office website and click the free download button.
  2. 2. Install the Software: Run the installer file and follow the on-screen prompts to set up WPS Office on your device.
  3. 3. Sign In and Sync: Log in to enable cloud syncing and start opening your Microsoft Office documents seamlessly.
Fully compatible with Microsoft Office formats (Word, Excel, PowerPoint)Built-in cloud storage for seamless document backup and synchronizationLightweight installation with fast loading times and minimal system impactFamiliar, user-friendly interface for effortless migration
microsoft office alternative - wps office

Frequently Asked Questions

Why doesn't my HLS player work with standard OneDrive sharing links?

OneDrive generates sharing links using unique alphanumeric file IDs rather than absolute folder paths. HLS players require standard directory structures to dynamically locate sequential TS media segments relative to the original M3U8 playlist file.

Can I use OneDrive as a CDN for public video hosting?

While possible for small-scale direct downloads, it is not recommended. OneDrive lacks the robust delivery infrastructure, bandwidth allocation, and path-routing capabilities of a dedicated Content Delivery Network, which can lead to rate limiting and broken playback.

What is the purpose of the SourceUrl parameter in SharePoint links?

The SourceUrl parameter instructs the SharePoint or OneDrive server to locate and trigger the download of a file based on its specific directory location (e.g., /Documents/Media/video.mp4) rather than relying on a randomly generated sharing identifier.