Static document links for PDFs in SharePoint Online

Thilina Tantirigama 86 Reputation points
2024-07-23T02:11:35.34+00:00

Hi,

We have a number of PDFs saved in a SPO library that we use for the company's intranet sites.

Currently, when we save PDF files, the document links contain the "folder path" (incl. sub-folders) the documents are located in.

This poses a challenge when we move files between folders or rename folders, what happens is the document links also change, and consequently the links on the intranet also break.

Is there a way to keep document links unique & static for PDFs in SharePoint?

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,674 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Ling Zhou_MSFT 17,135 Reputation points Microsoft Vendor
    2024-07-23T09:10:11.0933333+00:00

    Hi @Thilina Tantirigama,

    Thank you for posting in this community.Are you using the path to the file instead of the link to the file?

    The path of the file changes because of the file's storage address or the renaming of the file, while the link to the file does not.

    File Path:

    User's image

    File Link:

    User's image

    The link to the file is the unique encoding of the file on this site. As long as the file exists, the encoding will not change, even if the file is renamed or moved around the site.

    User's image For more information on copying links, you can refer to section Share by using "Copy link" in this article: Share SharePoint files or folders.

    Hope this information is helpful to you.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Ling Zhou_MSFT 17,135 Reputation points Microsoft Vendor
    2024-07-24T06:16:34.6233333+00:00

    Hi @Thilina Tantirigama,

    Thank you for your reply.

    Can you view the link you copied in the Manage access > Links?

    User's image

    User's image

    Because we are copying the sharing link. When we access the shared link, we will automatically jump to another address, and this address will still show the address where the file is stored in the URL. You should use the copied URL instead of the redirected URL.

    This is the sharing link we copied:

    User's image

    This is the URL that we jump to after accessing the copied link:

    User's image


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.