unable to copy files

Glenn Maxwell 11,496 Reputation points
2024-08-28T22:43:09.4633333+00:00

Hi All,

I have a folder on my F Drive that is 30GB in size, containing a lot of files and subfolders. I also have a SharePoint site where I want to upload this 30GB folder. I clicked "Sync" on the SharePoint folder, which has mapped it to my local server (C:\Download).

When I try to copy this 30GB folder, I am getting the following error: "The file name(s) would be too long for the destination folder. You can shorten the file name and try again, or try a location that has a shorter path."

I am also encountering this error when I try to upload the folder directly to the SharePoint site. Is there any way to copy files with paths longer than the 256-character limit?

Windows Server 2019
Windows Server 2019
A Microsoft server operating system that supports enterprise-level management updated to data storage.
3,797 questions
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
13,227 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,827 questions
Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,578 questions
SharePoint Server Management
SharePoint Server Management
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Management: The act or process of organizing, handling, directing or controlling something.
2,961 questions
0 comments No comments
{count} votes

Accepted answer
  1. Jing Zhou 7,260 Reputation points Microsoft Vendor
    2024-08-30T06:40:46.9866667+00:00

    Hello,

     

    Thank you for posting in Q&A forum.

    Normally it's recommended to follow 256-character limit, meanwhile you can try robocopy as a workaround:

    For example, if you cannot delete a directory due to the path length limit, you can first move the data from that directory using robocopy:

    ROBOCOPY c:\folder1\folder2\folder3\longpath c:\tmp /MOVE /E

    REF: https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/robocopy

     

    I hope the information above is helpful.

    If you have any questions or concerns, please feel free to let us know.

     

    Best regards,

    Jill Zhou

     


    If the Answer is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Maycon Batista 336 Reputation points
    2024-08-29T01:11:33.3066667+00:00

    Hi Glenn.

    Limitations of SharePoint Online:

    SharePoint 400 Character URL limit

    This limit is also happening way too often when users migrate from file shares to SharePoint Online. As you create folders and subfolders in a document library – the URL path to the content becomes longer and longer. The limit for the relative URL in SharePoint is 400 characters. Once you encounter the limit – you will start getting the error messages. The 400-character limit includes the length of your site name, document library name, folders, and file. It does not count the characters in the domain/tenant name. For example, if the folder/document URL is https://{your_tenant}.sharepoint.com/sites/accounting/Shared Documents/Folder A/Document 123, it only counts the characters highlighted in BOLD above (starting with sites).

    How to mitigate SharePoint 400 Character URL limit

    • Create sites and document libraries with shorter names
    • Flatten the folder hierarchy within a document library (remove multiple layers of folders)
    • Change the length of the folder and file names
    • Consider using metadata

    Windows 256 Character path limit

    An even stricter limit you might encounter is the 256-character limit on your Windows PC. As users syncchronize the document libraries to their PCs, they will encounter error messages when trying to do anything within synchronized document libraries (i.e., create folders, rename documents, etc.).

    Symptoms

    Inability to create new folders within synchronized libraries – getting an error message above

    Inability to create or rename documents within folders that take the path above the 256 limit in the synchronized document libraries

    Inability to copy documents or folders into the folders that are taking the path beyond the 256 limit in the synchronized document libraries

    How to mitigate Windows 256 character path limit

    • Disable sync for the document libraries

    Flatten the folder hierarchy within the libraries

    • Consider using metadata in SharePoint

    You can try moving the folder to the root of the drive. For example, if the files are within the "files" folder at "C:\Users\NameUser\files", move them to "C:\files".

    If there are any misunderstandings, please let me know

    Best regards,

    Maycon Novaes

    If the Answer is helpful, please click "Accept Answer" and upvote it.


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.