SOLVED
Home

Get direct download link of a file in OneDrive for Business

%3CLINGO-SUB%20id%3D%22lingo-sub-149766%22%20slang%3D%22en-US%22%3EGet%20direct%20download%20link%20of%20a%20file%20in%20OneDrive%20for%20Business%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-149766%22%20slang%3D%22en-US%22%3E%3CP%3EI%20use%20%22Get%20Link%22%20button%20and%20it%20gives%20me%20a%20link%20(like%20below)%20which%20will%20open%20the%20file%20online.%26nbsp%3B%20How%20can%20I%20get%20a%20link%20for%20direct%20file%20download%3F%26nbsp%3B%20Thanks.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3Ehttps%3A%2F%2F*****-my.sharepoint.com%2F%3Aw%3A%2Fg%2Fpersonal%2F********%2FEXhbZTdvlFRIqyBE8crSXggBW8l_yrcZFPTb5fEpAdzB3g%3Fe%3Di3XdFf%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-149766%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EOneDrive%20for%20Business%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-236377%22%20slang%3D%22en-US%22%3ERe%3A%20Get%20direct%20download%20link%20of%20a%20file%20in%20OneDrive%20for%20Business%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-236377%22%20slang%3D%22en-US%22%3E%3CP%3EThat's%20because%20PDF's%20are%20opening%20directly%20in%20your%20browser%20from%20the%20location%20via%20a%20plugin.%20If%20using%20chrome%20you%20can%20use%20this%20method%20to%20cause%20them%20to%20download%2C%20but%20it's%20a%20browser%20thing%2C%20not%20a%20download%20%2F%20server%20thing%2C%20you're%20actually%20downloading%20it%2C%20it's%20just%20your%20browser%20picking%20it%20up%2C%20so%20you%20can%20either%20click%20the%20download%20link%20they%20provide%20in%20the%20plugin%20but%20that's%20the%20only%20way%20to%20get%20pdf's%20to%20download%20outside%20of%20zipping%20them%20etc.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fsuperuser.com%2Fquestions%2F30850%2Fstop-pdfs-from-displaying-inside-google-chrome%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fsuperuser.com%2Fquestions%2F30850%2Fstop-pdfs-from-displaying-inside-google-chrome%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-236368%22%20slang%3D%22en-US%22%3ERe%3A%20Get%20direct%20download%20link%20of%20a%20file%20in%20OneDrive%20for%20Business%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-236368%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20in%20the%20same.%20Can't%20seem%20to%20get%20it%20to%20work%20on%20PDFs%20which%20is%20the%20main%20file%20type%20I%20need.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-218823%22%20slang%3D%22en-US%22%3ERe%3A%20Get%20direct%20download%20link%20of%20a%20file%20in%20OneDrive%20for%20Business%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-218823%22%20slang%3D%22en-US%22%3EYou%20da%20real%20mvp%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-202245%22%20slang%3D%22en-US%22%3ERe%3A%20Get%20direct%20download%20link%20of%20a%20file%20in%20OneDrive%20for%20Business%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-202245%22%20slang%3D%22en-US%22%3EDepending%20on%20your%20Url%20you%20might%20have%20to%20use%20%3Fdownload%3D1%20but%20this%20won%E2%80%99t%20work%20for%20every%20single%20file%20type%20either%20think%20only%20office%20files.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-202167%22%20slang%3D%22en-US%22%3ERe%3A%20Get%20direct%20download%20link%20of%20a%20file%20in%20OneDrive%20for%20Business%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-202167%22%20slang%3D%22en-US%22%3E%3CP%3EIt%20does%20not%20seam%20to%20work%20for%20me.%20I%20always%20end%20up%20on%20the%20download%20page.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-150108%22%20slang%3D%22en-US%22%3ERe%3A%20Get%20direct%20download%20link%20of%20a%20file%20in%20OneDrive%20for%20Business%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-150108%22%20slang%3D%22en-US%22%3E%3CP%3EChristopher's%20method%20works%20like%20a%20magic.%26nbsp%3B%20It%20also%20works%20with%20%22Anyone%20with%20the%20link%22%20and%20%22People%20in%20my%20org%22%20mode.%26nbsp%3B%20Simply%20add%20%22%3CSTRONG%3E%26amp%3Bdownload%3D1%3C%2FSTRONG%3E%22%20to%20the%20end%20of%20link.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThanks%20Christopher%20and%20other%20people%20here%20for%20your%20replies.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-149888%22%20slang%3D%22en-US%22%3ERe%3A%20Get%20direct%20download%20link%20of%20a%20file%20in%20OneDrive%20for%20Business%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-149888%22%20slang%3D%22en-US%22%3EWell%20I%20just%20took%20a%20logical%20guess%20and%20it%20totally%20worked%20lol....%20so%20do%20this.%20%3CBR%20%2F%3E%3CBR%20%2F%3EUse%20%22Get%20link%22%2C%20then%20use%20%22People%20with%20existing%20access%22%20to%20get%20the%20direct%20link%20to%20the%20file.%20%3CBR%20%2F%3E%3CBR%20%2F%3EThen%2C%20the%20url%20will%20be%20direct%20path%20to%20%3CA%20href%3D%22https%3A%2F%2Forg.sharepoint.com%2Fpersonal%2Fuser_org%2Ffolder%2Ffilename.ext%3Fd%3Doiuqjaweorihjlkj%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Forg.sharepoint.com%2Fpersonal%2Fuser_org%2Ffolder%2Ffilename.ext%3Fd%3Doiuqjaweorihjlkj%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3ENow%2C%20just%20remove%20everything%20after%20the%20%3F%20and%20put%20in%20download%3D1%20and%20magic%20happens.%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Forg.sharepoint.com%2Fpersonal%2Fuser_org%2Ffolder%2Ffilename.ext%3Fdownload%3D1%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Forg.sharepoint.com%2Fpersonal%2Fuser_org%2Ffolder%2Ffilename.ext%3Fdownload%3D1%3C%2FA%3E%20%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-149821%22%20slang%3D%22en-US%22%3ERe%3A%20Get%20direct%20download%20link%20of%20a%20file%20in%20OneDrive%20for%20Business%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-149821%22%20slang%3D%22en-US%22%3EAFAIK%2C%20there%20is%20not%20a%20way%20to%20get%20a%20download%20link%20for%20a%20file%20stored%20in%20SPO%20%2F%20ODFB%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-149782%22%20slang%3D%22en-US%22%3ERe%3A%20Get%20direct%20download%20link%20of%20a%20file%20in%20OneDrive%20for%20Business%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-149782%22%20slang%3D%22en-US%22%3E%3CP%3EWas%20expecting%20to%20see%20some%20controls%2C%20but%20I%20don't%20see%20them%20either%20when%20using%20Azure%20B2B%20guest%20access.%20The%20new%20secure%20sharing%20feature%20for%20OD%2FSPO%20does%20give%20me%20the%20control%20on%20top.%20Workaround%20for%20me%20is%20to%20remove%20the%20last%20part%20of%20the%20URL%2C%20which%20gives%20me%20the%20library%2Ffolder%20view%20and%20there%20I%20have%20the%20option%20to%20select%20the%20file%20and%20click%20on%20the%20download%20button.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-778234%22%20slang%3D%22en-US%22%3ERe%3A%20Get%20direct%20download%20link%20of%20a%20file%20in%20OneDrive%20for%20Business%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-778234%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F30671%22%20target%3D%22_blank%22%3E%40Chris%20Lo%3C%2FA%3EI%20wanted%20to%20get%20a%20GIF%20file%20stored%20on%20OneDrive%20to%20be%20shown%20on%20another%20site.%20I%20right%20clicked%20the%20file%20and%20chose%20%22view%20online%22%2C%20then%20right%20clicked%20the%20GIF%20in%20the%20browser%20and%20chose%20%22copy%20image%20location%22%20which%20gave%20me%20a%20long%20URL%20ending%20with...%20CWDi2g%2Flockar.gif%3Fdownload%26amp%3Bpsid%3D1%20where%20I%20then%20removed%20everything%20after%20%22lockar.gif%22.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThat%20worked%20for%20me.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-778258%22%20slang%3D%22en-US%22%3ERe%3A%20Get%20direct%20download%20link%20of%20a%20file%20in%20OneDrive%20for%20Business%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-778258%22%20slang%3D%22en-US%22%3Ewhich%20will%20work%20assuming%20you%20or%20the%20users%20accessing%20where%20that%20image%20is%2C%20are%20authenticated%20to%20your%20tenant%20SharePoint%20%3A).%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-809736%22%20slang%3D%22en-US%22%3ERe%3A%20Get%20direct%20download%20link%20of%20a%20file%20in%20OneDrive%20for%20Business%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-809736%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F875%22%20target%3D%22_blank%22%3E%40Christopher%20Webb%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3E%3CSPAN%3EThank%20you%20so%20much%2C%20it%20worked%20for%20me.%20In%20the%20past%201%20year%2C%20my%20users%20have%20trouble%20downloading%20compressed%20folders%20stored%20on%20Onedrive.%20You%20can%20read%20this%20problem%20here%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fwww.yannickborghmans.com%2F2018%2F05%2F19%2Fonedrive-some-files-werent-downloaded%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.yannickborghmans.com%2F2018%2F05%2F19%2Fonedrive-some-files-werent-downloaded%2F%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20problem%20that%20people%20encounter%20is%20trying%20to%20download%20a%20file%20in%20the%20compressed%20folder%20and%20that's%20when%20an%20error%20occurs.%20I%20tried%20many%20ways%20to%20create%20direct%20links%20from%20Onedrive%20like%20using%20the%20embed%20code%20but%20it%20doesn't%20work.%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-810105%22%20slang%3D%22en-US%22%3ERe%3A%20Get%20direct%20download%20link%20of%20a%20file%20in%20OneDrive%20for%20Business%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-810105%22%20slang%3D%22en-US%22%3ECool%20to%20see%20after%20all%20this%20time.%20You%20Probabaly%20can%20just%20do%20%26amp%3Bdownload%3D1%20without%20removing%20the%20unique%20tail%20end%20of%20the%20document%20url.%3C%2FLINGO-BODY%3E
Highlighted
Chris Lo
Occasional Contributor

I use "Get Link" button and it gives me a link (like below) which will open the file online.  How can I get a link for direct file download?  Thanks.

 

https://*****-my.sharepoint.com/:w:/g/personal/********/EXhbZTdvlFRIqyBE8crSXggBW8l_yrcZFPTb5fEpAdzB3g?e=i3XdFf

13 Replies

Was expecting to see some controls, but I don't see them either when using Azure B2B guest access. The new secure sharing feature for OD/SPO does give me the control on top. Workaround for me is to remove the last part of the URL, which gives me the library/folder view and there I have the option to select the file and click on the download button. 

AFAIK, there is not a way to get a download link for a file stored in SPO / ODFB
Solution
Well I just took a logical guess and it totally worked lol.... so do this.

Use "Get link", then use "People with existing access" to get the direct link to the file.

Then, the url will be direct path to https://org.sharepoint.com/personal/user_org/folder/filename.ext?d=oiuqjaweorihjlkj

Now, just remove everything after the ? and put in download=1 and magic happens.

https://org.sharepoint.com/personal/user_org/folder/filename.ext?download=1

Christopher's method works like a magic.  It also works with "Anyone with the link" and "People in my org" mode.  Simply add "&download=1" to the end of link.

 

Thanks Christopher and other people here for your replies.

It does not seam to work for me. I always end up on the download page.

Depending on your Url you might have to use ?download=1 but this won’t work for every single file type either think only office files.

I am in the same. Can't seem to get it to work on PDFs which is the main file type I need.

That's because PDF's are opening directly in your browser from the location via a plugin. If using chrome you can use this method to cause them to download, but it's a browser thing, not a download / server thing, you're actually downloading it, it's just your browser picking it up, so you can either click the download link they provide in the plugin but that's the only way to get pdf's to download outside of zipping them etc. 

 

https://superuser.com/questions/30850/stop-pdfs-from-displaying-inside-google-chrome

 

 

@Chris LoI wanted to get a GIF file stored on OneDrive to be shown on another site. I right clicked the file and chose "view online", then right clicked the GIF in the browser and chose "copy image location" which gave me a long URL ending with... CWDi2g/lockar.gif?download&psid=1 where I then removed everything after "lockar.gif".

 

That worked for me.

which will work assuming you or the users accessing where that image is, are authenticated to your tenant SharePoint :).

@Christopher Webb 
Thank you so much, it worked for me. In the past 1 year, my users have trouble downloading compressed folders stored on Onedrive. You can read this problem here: https://www.yannickborghmans.com/2018/05/19/onedrive-some-files-werent-downloaded/

The problem that people encounter is trying to download a file in the compressed folder and that's when an error occurs. I tried many ways to create direct links from Onedrive like using the embed code but it doesn't work.


Cool to see after all this time. You Probabaly can just do &download=1 without removing the unique tail end of the document url.
Related Conversations