pnp / PnP-PowerShell

SharePoint PnP PowerShell CmdLets
https://pnp.github.io/powershell
Other
990 stars 663 forks source link

Copy-PnPFile throw The remote server returened: (404) Not Found Error when File Name contains Special Characters such as "$" or "#" #2360

Open paradox133 opened 4 years ago

paradox133 commented 4 years ago

Reporting an Issue or Missing Feature

Issue may related to feature #1789 but not fixed

Expected behavior

Should copy the file with no error

Actual behavior

Copy-PnPFile throw The remote server returened: (404) Not Found Error when File Name contains Special Characters such as "$" or "#"

Steps to reproduce behavior

$SiteRelativeUrl="sites/SiteA/LibB/FolderC/Doc#25_Hub.jpg" $TargetUrl="sites/SiteC/LibD/FolderF/PrefixG_Doc#25_Hub.jpg" Copy-PnpFile - SourceUrl $SiteRelativeUrl -TargetUrl $TargetUrl

Which version of the PnP-PowerShell Cmdlets are you using?

What is the version of the Cmdlet module you are running?

3.15.19.11.0

How did you install the PnP-PowerShell Cmdlets?

ghost commented 4 years ago

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

paradox133 commented 4 years ago

Tested and found the following is Okay $SiteRelativeUrl="/sites/SiteA/LibB/FolderC/Doc%25_Hub.jpg" $TargetUrl="/sites/SiteC/LibD/FolderF/Doc25_Hub.jpg" Copy-PnpFile - SourceUrl $SiteRelativeUrl -TargetUrl $TargetUrl

Tested and found the following brings (404) Not Found Error $SiteRelativeUrl="/sites/SiteA/LibB/FolderC/Doc#25_Hub.jpg" $TargetUrl="/sites/SiteC/LibD/FolderF/Doc_25_Hub.jpg" Copy-PnpFile - SourceUrl $SiteRelativeUrl -TargetUrl $TargetUrl

Special Characters % and # behave Differently in the same test.