OneDrive Moving Files Automatically Updates References in HTML Files

Jeremy Shinn 1 Reputation point
2022-10-17T15:04:00.477+00:00

I have the same problem that's presented in this locked thread (with no public answer): https://answers.microsoft.com/en-us/msoffice/forum/all/rename-or-move-a-file-changes-the-path-in-html/6a655411-ace4-428b-bafd-146f24f47052

Create an HTML file in any SharePoint folder (directly in the folder, not through SharePoint, it's just an html file, not a SharePoint page). Then link to another file in the SharePoint folder or reference an image via an IMG tag. Then change the name of the image or file you're linking to and it automatically updates the reference in the HTML file. I don't want it to do this. I have a bunch of HTML files (unfortunately) and when I need to swap something out with something new I have to go back into all the files and change the links/references back. Annoying.

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

3 answers

Sort by: Most helpful
  1. Yi Lu_MSFT 17,461 Reputation points
    2022-10-19T09:34:57.183+00:00

    Hi @Jeremy Shinn
    Per my test, I need not change the links/references back when I rename the file stored in SharePoint folder.

    1. I have uploaded the html file as the type of aspx because I could not open html file normally in SharePoint document library. As to the link I use in the html code, it is a copy link in the "Share" function.

    251953-image.png

    2.Firstly I could open the link normally, then I rename the file which the link points to. In my test, I could also open the link after the file name is changed.

    251981-image.png


    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. Yi Lu_MSFT 17,461 Reputation points
    2022-11-03T09:51:00.3+00:00

    Hi @Jeremy Shinn
    I have reproduced your problem on my site, it seems that this is by-design and this is for the accuracy of the data.

    In other words, if <a href="another_picture.jpg">Picture</a> would not change after you rename the "another_picture.jpg" file to "another_picture_old.jpg", how it will come when
    you upload another file named "another_picture.jpg"? Would the link be redirected to the new file instead of the old one?

    If you still want to achieve your goal, I would suggest you to send feedback to Microsoft SharePoint Feedback.


    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

  3. Jeremy Shinn 1 Reputation point
    2022-11-10T15:43:42.613+00:00

    I appreciate your help.

    0 comments No comments