Credits too Method-Team
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 share link. But, how to get OneDrive direct link to file? How to get permanent link to OneDrive?
What’s the use of direct/permanent link? Direct link is very useful while you want to provide a download link, anyone can download a file by clicking the direct link. And, for a website, it’s very important to have direct file link for downloadable items. Users don’t have to leave the website to download a file.
Follow the two simple steps to get OneDrive permanent link or OneDrive direct link to file –
To get embed code, open OneDrive and open the file folder and then select the file you want to share. And then right-click mouse on the file. From the options, click on the “Embed” (see the picture below).
After this, embed code will be generated for the file. Copy (Ctrl + C to copy) the embed code by clicking on it.
If you have copied the embed code, go to step 2. Can’t get the embed code yet? There is another way to get the embed code! After selecting the item you want to share, click on the dots as seen in the picture. And then click on the “Embed” from the options.
The embed code will be generated for the file, copy the embed code for the file.
Now, paste the embed code you copied in a notepad or a text editor. This code looks like this one –
<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 source URL https://onedrive.live.com/embed?cid=FA476CAFF1A7E75C&resid=FA476CAFF1A7E75C%21122&authkey=AN_axXpcOy7Zfl8 and then just replace embed with download to get direct/permanent link.
After this modification, the link should look like this –
That’s the OneDrive direct link to the file and its a permanent link. So you can use the link for lifetime! The direct/permanent link will skip the Google Drive web viewer. You can test the link we shared. It should start download without going OneDrive website.
You can get OneDrive direct/permanent link for any file by this process. The best thing is, OneDrive provides permanent links for large files also, where Google Drive doesn’t. There is no way to skip Google Drive web viewer for large files (larger than 100MB).
Hope for the best! Let’s discuss through comments 🙂