Forum Discussion
RehmanR
Jun 16, 2022Copper Contributor
Hyperlinks to PDF files on SharePoint Online
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
RehmanR Try below steps, it gives me the file URL without filename in it.
- Go to document library
- Select document for which you need the URL/link
- Click on Copy link option
- Choose option like: People in your tenant with the link can view and click "Copy".
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.
- NevilleStebbingsCopper Contributor
I have a related but opposite problem. I have a large amountg of documentation which I manage in SharePoint. The documentation contains an Excel spreadsheet as an index with hyperlinks to related documents and folders. I want to be able to download that and then hand it off to another organisation unconnected to my domain so they can access the documents. They are not permitted to have a link to my SharePoint or OneDrive. I want the hyperlinks still to work outside of the SharePoint environment without having to manually recreate them outside of SharePoint. How can that be achieved?
RehmanR Try below steps, it gives me the file URL without filename in it.
- Go to document library
- Select document for which you need the URL/link
- Click on Copy link option
- Choose option like: People in your tenant with the link can view and click "Copy".
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.
- RehmanRCopper Contributor
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.