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.
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.
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.
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 🙂
Thanks it worked as a magic.
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.
No, You can’t download a folder with a permanent link. Thank’s
Nice tutorial..
I love it because it is very essential.
you make my life downloadable. it works!
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.
Hi,
I have the same problem it says the item has been removed from OneDrive even though ur link has been working. I am trying to generate download link of 25 gb of photographs
It looks like you’re talking about a folder! There is no way to get a native download link for a OneDrive folder. A single file? Please share the link so we can check. Thanks
Hi, can i get a script where I can generate it automatically by html
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!
Thank you so much. I was searching for days to find this solution.
Still works a treat! thank you! 🙂
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
Thanks for the tip!
How do I get direct links in OneDrive that have the file name in it? For example, onedrive.live.com/xxxx/filename.jpg
A king among men! Thank you!
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.
Thanks for sharing great knowledge sir, is there a way to get direct download link with file extinction.
Nope. You can’t get a direct download link from OneDrive with the file extensions.
it doesn’t work because Microsoft requires you to authenticate in any case