How to Get Direct or Permanent Link for OneDrive Files?

How to Get Direct or Permanent Link for OneDrive Files?

OneDrive is one of the most popular cloud file storage service developed by Microsoft. You can easily share the files and folders that you store in OneDrive by creating a share link. But how to get a direct/native link for OneDrive files? How to get a permanent link for OneDrive files?

What’s the use of native links? Native/direct link is needed especially for cloud files while you want to provide a download link, anyone can download a file by clicking on the native link. And for a publisher, it’s very important to have native/permanent file link for downloadable items.

Like most other cloud-hosted file-sharing sites, OneDrive doesn’t provide native links for the files you store there. But it’s very easy to get them by doing simple tricks!

Get Direct/Permanent Link for OneDrive Files

To get a direct or permanent link for an OneDrive file, follow the two simple steps below:

Step 1. Get OneDrive File Embed Code

To get the embed code for a file, open the OneDrive folder containing the file you want to share and then right-click the mouse on the file to get all available menu options for the file.

Get OneDrive Embed Link Right Click

From the options, click on the “Embed” menu option. After this, the embed code will be generated for the file in a new window. Now Copy (Ctrl + C to copy) the file embed code by clicking on it.

OneDrive Embed Link Generated

Haven’t got it yet? You can also get the embed code by clicking on the dots (•••) after selecting the file you want to share as seen in the picture below.

Get OneDrive Embed Link Top Bar

After finishing the copy operation, paste the embed code in a notepad or text editor.

Step 2. Modify OneDrive File Embed Code

Let’s start the embed code modification! An OneDrive embed code looks like the following:

<iframe src="https://onedrive.live.com/embed?cid=FA476CAFF1A7E75C&resid=FA476CAFF1A7E75C%21122&authkey=AN_axXpcOy7Zfl8" width="98" height="120" frameborder="0" scrolling="no"></iframe>

You have to modify this code, remove everything except the source URL of the file and then replace embed with download to get direct/permanent link. After the modification, we get:

https://onedrive.live.com/download?cid=FA476CAFF1A7E75C&resid=FA476CAFF1A7E75C%21122&authkey=AN_axXpcOy7Zfl8

That’s it! That’s the direct or native link for the OneDrive file and it’s a permanent link. The direct/permanent link will skip the OneDrive web viewer. You can test the link we shared in the process. It should start to download without going to the OneDrive website.

You can get OneDrive direct/permanent/native link for any file by this process. The best thing is, OneDrive provides native links for large files also, where Google Drive doesn’t provide for large files. There is no way to skip Google Drive web viewer for large files (larger than 100MB)!

Hope for the best! Let’s discuss more through comments 🙂

15 Comments on this.

  1. hi,
    there is anyway we can convert the shared link to a direct one?
    so like we can write a python script where a use gives the shared onedrive link and the script converts it to the direct one?
    thanks.

  2. Hi,

    How can i bulk export the direct link for files in a onedrive for business folder ? For example I have 1000 photos in the onedrive folder and I want the direct link for each photo to be exported to excel.

    Regards,
    Muhamed Rafeeq

  3. Thank you! I had gotten myself to the embed link but hadn’t thought of modifying “embed” in the URL to “download”. Love the help!

  4. Hi,

    This won’t work for me. Each time I click the link it says Opens onedrive and says “This page can’t be opened in the OneDrive app. Do you want to open it in your browser?” and then when I click to open in browser the page says “This link has been removed”

    What am I doing wrong (This is a vCard I am trying to download)

    • We’ve tested the link we provided from mobile and desktop, it’s working as expected. Have you tested the link given in the article? If it’s not working for you, then please reply.

  5. Great, it works (for a file)!
    But can we do the same to a folder?
    Downloading a folder in OneDrive results in an archived file.

Leave a Reply

Your email address will not be published. Your comments must follow our guidelines.