SOLVED

Hyperlinks to PDF files on SharePoint Online

%3CLINGO-SUB%20id%3D%22lingo-sub-3517207%22%20slang%3D%22en-US%22%3EHyperlinks%20to%20PDF%20files%20on%20SharePoint%20Online%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3517207%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20Everyone%2C%3CBR%20%2F%3E%3CBR%20%2F%3EI%20noticed%20recently%20that%20some%20links%20to%20PDF%20files%20have%20different%20structure%20from%20others%20on%20SharePoint%20site%20pages.%20Please%20see%20below.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EType%201%20links%20are%20not%20filename%20dependent%20and%20they%20still%20work%20after%20changing%20the%20pdf%20filename.%20Type%202%20links%20break%20on%20changing%20the%20pdf%20filename.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20problem%20is%20that%20I%20can't%20figure%20out%20how%20can%20we%20generate%20Type%201%20link.%20The%20old%20Type%201%20links%20were%20created%20by%20me%20but%20now%20when%20I%20copy%20a%20link%2C%20it%20is%20always%20of%20Type%202.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%20data-unlink%3D%22true%22%3E%3CSTRONG%3EType%201%3A%3C%2FSTRONG%3E%20https%3A%2F%2Fcompanyname.sharepoint.com%2F%3Ab%3A%2Fs%2Fsitename-site%2FEXqLjvwVtC5PkdaswnazXQBwGGq-78nGubadfqw4erCdnvfDQ%3Fe%3DG87sbfhP%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%20data-unlink%3D%22true%22%3E%3CSTRONG%3EType%202%3A%3C%2FSTRONG%3E%20https%3A%2F%2Fcompanyname.sharepoint.com%2F%3Ab%3A%2Fr%2Fsites%2Fsitename-site%2F%26nbsp%3B%3CSTRONG%3ELibrary%2520Name%3C%2FSTRONG%3E%2F%3CSTRONG%3EDocument%2520Name.pdf%3C%2FSTRONG%3E%3Fcsf%3D1%26amp%3Bweb%3D1%26amp%3Be%3DUrWqpRu%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3517207%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDocument%20Library%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Efiles%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3519603%22%20slang%3D%22en-US%22%3ERe%3A%20Hyperlinks%20to%20PDF%20files%20on%20SharePoint%20Online%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3519603%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1322970%22%20target%3D%22_blank%22%3E%40RehmanR%3C%2FA%3E%26nbsp%3BTry%20below%20steps%2C%20it%20gives%20me%20the%20file%20URL%20without%20filename%20in%20it.%3C%2FP%3E%3COL%3E%3CLI%3EGo%20to%20document%20library%3C%2FLI%3E%3CLI%3ESelect%20document%20for%20which%20you%20need%20the%20URL%2Flink%3C%2FLI%3E%3CLI%3EClick%20on%26nbsp%3B%3CSTRONG%3ECopy%20link%3C%2FSTRONG%3E%20option%26nbsp%3B%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22ganeshsanap_0-1655452306907.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ganeshsanap_0-1655452306907.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ganeshsanap_0-1655452306907.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ganeshsanap_0-1655452306907.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ganeshsanap_0-1655452306907.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ganeshsanap_0-1655452306907.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ganeshsanap_0-1655452306907.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F381227i6EB5C0C70CCA065B%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22ganeshsanap_0-1655452306907.png%22%20alt%3D%22ganeshsanap_0-1655452306907.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3EChoose%20option%20like%3A%20%3CEM%3EPeople%20in%20your%20tenant%20with%20the%20link%20can%20view%3C%2FEM%3E%20and%20click%20%22Copy%22.%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22ganeshsanap_1-1655452559565.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ganeshsanap_1-1655452559565.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ganeshsanap_1-1655452559565.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ganeshsanap_1-1655452559565.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ganeshsanap_1-1655452559565.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ganeshsanap_1-1655452559565.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ganeshsanap_1-1655452559565.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F381228i0F65F90443B32058%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22ganeshsanap_1-1655452559565.png%22%20alt%3D%22ganeshsanap_1-1655452559565.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FLI%3E%3C%2FOL%3E%3CP%3EIt%20gives%20me%20the%20correct%20URL%20as%20per%20the%26nbsp%3B%3CSTRONG%3EType%201%3C%2FSTRONG%3E.%3C%2FP%3E%3CHR%20%2F%3E%3CP%3EPlease%20click%20%3CSTRONG%3EMark%20as%20Best%20Response%3C%2FSTRONG%3E%20%26amp%3B%20%3CSTRONG%3ELike%3C%2FSTRONG%3E%20if%20my%20post%20helped%20you%20to%20solve%20your%20issue.%20This%20will%20help%20others%20to%20find%20the%20correct%20solution%20easily.%20It%20also%20closes%20the%20item.%20If%20the%20post%20was%20useful%20in%20other%20ways%2C%20please%20consider%20giving%20it%20%3CSTRONG%3ELike%3C%2FSTRONG%3E.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3520736%22%20slang%3D%22en-US%22%3ERe%3A%20Hyperlinks%20to%20PDF%20files%20on%20SharePoint%20Online%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3520736%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%20Ganesh.%20It%20helped%20me%20figure%20out%20why%20the%20link%20structure%20changed.%20I%20was%20using%20the%20same%20method%20as%20you%20described%20previously%20but%20at%20some%20point%20I%20started%20using%20%22People%20with%20existing%20access%22%20which%20results%20in%20filename%20dependent%20links.%20I%20never%20realized%20this%20would%20be%20the%20issue.%20Now%20we%20can%20share%20read%20only%20links%20without%20worrying%20that%20a%20change%20in%20filename%20will%20break%20the%20links.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3520826%22%20slang%3D%22en-US%22%3ERe%3A%20Hyperlinks%20to%20PDF%20files%20on%20SharePoint%20Online%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3520826%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1322970%22%20target%3D%22_blank%22%3E%40RehmanR%3C%2FA%3E%26nbsp%3BGreat%2C%20glad%20it%20worked%20for%20you!%3C%2FP%3E%3CHR%20%2F%3E%3CP%3EPlease%20click%20%3CSTRONG%3EMark%20as%20Best%20Response%3C%2FSTRONG%3E%20%26amp%3B%20%3CSTRONG%3ELike%3C%2FSTRONG%3E%20if%20my%20post%20helped%20you%20to%20solve%20your%20issue.%20This%20will%20help%20others%20to%20find%20the%20correct%20solution%20easily.%20It%20also%20closes%20the%20item.%20If%20the%20post%20was%20useful%20in%20other%20ways%2C%20please%20consider%20giving%20it%20%3CSTRONG%3ELike%3C%2FSTRONG%3E.%3C%2FP%3E%3C%2FLINGO-BODY%3E
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.