If this blog title captured your attention, then you are very likely aware of the problem. You try to be a good SharePoint user and send links to documents hosted in SharePoint instead of attaching them to emails; but here lies the problem...

 

How to Get a Direct Link to a File in Modern SharePoint Online Libraries

Past are the days when you could go into a document library, right click on a file, and Copy shortcut. Now we get an entire list of confusing options. Is it possible to simply get a regular link? Keep reading to learn three different ways to get a direct link in SharePoint Online.

Office 365 Link Settings in Modern SharePoint Online

The good and the bad news is we are using Office 365. Microsoft is always evolving the platform, which is great, but that also means be prepared for constant changes and refinements. I’ve seen the "get a link" dialog box change quite a bit over time⁠—the old way of doing it can be seen in the screenshot above. 

In Office 365, clicking Copy Link is now synonymous with Sharing (i.e. changing security). The options listed below are what you see when right clicking on a document to share:

  • Anyone with the link
  • People in Contoso with the link
  • People with existing access
  • Specific people

link sharing settings in Office 365

The URL you get is something like this:

https://<tenant>.sharepoint.com/:p:/s/<site>/EXMTrhvbXx1LndCuIXvC2REBMDNqQs60LGWYyMdID2bStw?e=yryPco

Not quite what we are looking for. As you can see, you are able to get different types of links. You can get direct links to the files or you can get links that actually change the security of the file. 

If we use the default, Anyone with the link, SharePoint actually breaks security inheritance on that file and defines unique permissions tied to the file via the link under Links Giving Access.      

Broken permissions via SharePoint Online sharing link

The first thing to remember when using this default is every single time someone clicks Copy Link, its breaking permissions.

SharePoint Online broken file permissions on shared files via link

But what if we just want a standard link and don’t want to change security? Let’s look at three ways we can do this:

Option 1: "People With Existing Access" Link

If we just change our link option to People with existing access and click Apply, it will give us a link that looks like this:

https://<tenant>.sharepoint.com/:p:/r/sites/Marketing/Shared%20Documents/Branding%20Elements.pptx?d=w1bae13735fdb4b1d9dd0ae217bc2d911&csf=1&e=aojURR

SharePoint Online sharing People with existing access

The d= random characters on the end is for SharePoint to ensure it can find the file later if someone moves the file, but clicks this older link. So best practice is to keep the full link structure. 

Sharing via People with existing access is the best and preferred method. Changing the default to this option is also a good idea. Someone with SharePoint Administrator permissions needs to follow these instructions to set the default option to Direct – specific people

Option 2: Office Application

If you open the file in your local Office application (Word, Excel, etc.), you can get the direct path by clicking File –> Copy path.

Getting direct SharePoint Online link to file via Office Application

A URL is generated like this one:

https://<tenant>.sharepoint.com/sites/Marketing/Shared%20Documents/Branding%20Elements.pptx?web=1

By using this method, the file will open directly in the browser (i.e. Word Online). If you don’t want that, just remove the ending: ?web=1.

Option 3: Third Party Tools

Third party tools are available that integrate into Outlook, such as Harmon.IE, offering an option for link copying. The options will vary by tool. 

For example, in Harmon.IE you will browse through your library, right-click on the file, and choose either Link or Address. You can see how both options look below:

Well there you have it: three, easy ways to get a direct link in SharePoint Online! If you have any additional questions about SharePoint Online, permissions, modern document libraries or anything else, just reach out to us