Skip to main content

Notifications

Power Automate - Using Flows
Answered

Copy File error with '+' character in file name

(0) ShareShare
ReportReport
Posted on by 9

There must be a recent change to the Sharepoint Copy File action, because this has definitely worked many times.

 

I have a file with a '+' character in the filename like this "MyDocument_+abc.pdf"

Let's say the whole URL looks like this:

https://myWeb.sharepoint.com/sites/mySite/documents/MyDocument_+abc.pdf

 

My workflow should copy this file to another site/library, but I get the following error:

 

Failed to verify the existence of source object at

"https://myWeb.sharepoint.com/sites/mySite/documents/MyDocument_  abc.pdf" 

due to error 'The system cannot find the file specified. (Exception from HRESULT: 0x80070002)'.

 

It erases the '+' character and replaces it with a blank.

 

I've already tried to use uri encoding, so the file name would look like this "MyDocument_%2Babc.pdf", but I get the exact same error. I know that this has worked before, because in my company, they use a lot of '+' characters in file names and there was never a problem with the workflow until today. Is there any way to find out if there was a change in December 2021 with the power automate engine and how it handles those special characters?

 

  • Verified answer
    Mark277 Profile Picture
    Mark277 9 on at
    Re: Copy File error with '+' character in file name

    Hi @v-bofeng-msft 

    First, I've found a solution and thanks for your suggestion, it pointed me in the right direction.

     

    So, I've tried your solution first, but at first I got the same error message, as I'm using variables for the Site Address and File Path. When I manually pick the Site and File, it worked like in your post. It seems Power Automate is handling the values from variables and other inputs differently.

     

    What I noticed was, that when you use the actions "Copy File" or "Move File" and manually pick the files via the file explorer, the path gets encoded in a different way when the workflow is running. A blank space is usually %20, but here it's %2b and '+' should be %2B, but it's %252b and so on...

     

    My solution was to double encode the FilePath variable as well and then use that value to copy the file:

    encodeUriComponent(encodeUriComponent(variables('FilePath')))

     

  • Re: Copy File error with '+' character in file name

    Hi @mks227 :

    You could try to get the file id first , and then move the file by id. I've made a test for your reference:

    My Flow:

    vbofengmsft_1-1638769638139.png

     

    The Result:

    vbofengmsft_0-1638769620287.png

    Best Regards,

    Bof

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,666

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,996

Leaderboard

Featured topics

Restore a deleted flow