Created a document in the folder,and got the document id and the link for that document.But after moving it to another folder(by using , Site Settings>content and structure,and then moved ) Afterwards,the doc is not viewing by using the link generated before.
Generic URL links to documents can change when you change them like renaming or moving them from one folder to another or by renaming the folder or file where they are located.
GUIDs (Globally Unique Identifiers) are identifiers for things in SharePoint (Files, Folders, Lists, etc.). GUIDs stay the same even though the properties of the element changes (Name, location, etc.)
You can use PowerShell or some other programmatic technique to directly call that object with its GUID, and no matter where it is you can find it.
The URL path is text information that IIS uses to figure out where you want to go like a map. Since each thing in SharePoint has a GUID, when you move those things around (like a file to another folder) their relationship changes (e.g. the path to where they are located changes). So how you get to that file changes even though the GUIDs of each element will not.
So for all practical purposes:
- If you move a file, list, etc you will have to relink it.
- If you rename a file, list, etc and are not using GUIDs in the URL path you will have to relink it.
This article will show you the relationship between the URL and a GUID
Here is a tool to help decode the GUID in a URL
Hope this helps.