SOLVED

Hyperlinks to PDF files on SharePoint Online

Occasional Contributor

Hello Everyone,

I noticed recently that some links to PDF files have different structure from others on SharePoint site pages. Please see below.

 

Type 1 links are not filename dependent and they still work after changing the pdf filename. Type 2 links break on changing the pdf filename.

 

The problem is that I can't figure out how can we generate Type 1 link. The old Type 1 links were created by me but now when I copy a link, it is always of Type 2.

 

Type 1: https://companyname.sharepoint.com/:b:/s/sitename-site/EXqLjvwVtC5PkdaswnazXQBwGGq-78nGubadfqw4erCdnvfDQ?e=G87sbfhP 

 

Type 2: https://companyname.sharepoint.com/:b:/r/sites/sitename-site/ Library%20Name/Document%20Name.pdf?csf=1&web=1&e=UrWqpRu

 

 

3 Replies
best response confirmed by RehmanR (Occasional Contributor)
Solution

@RehmanR Try below steps, it gives me the file URL without filename in it.

  1. Go to document library
  2. Select document for which you need the URL/link
  3. Click on Copy link option ganeshsanap_0-1655452306907.png
  4. Choose option like: People in your tenant with the link can view and click "Copy".ganeshsanap_1-1655452559565.png

It gives me the correct URL as per the Type 1.


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

Thanks Ganesh. It helped me figure out why the link structure changed. I was using the same method as you described previously but at some point I started using "People with existing access" which results in filename dependent links. I never realized this would be the issue. Now we can share read only links without worrying that a change in filename will break the links.

@RehmanR Great, glad it worked for you!


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.