Skip to main content

Notifications

Community site session details

Community site session details

Session Id : qBluNncw+ZZP3lsqkj7RQx
Power Automate - Building Flows
Answered

SFTP file from email attachment

Like (0) ShareShare
ReportReport
Posted on 11 Dec 2023 14:40:06 by 2

I am trying to create a workflow that copies an email attachment (CSV) to a remote server using SFTP. It appears to work, but when I download the file it appears as a random assortment of characters. I have a separate workflow that did the exact same thing that was working, but now appears to be doing the same thing. Here is the workflow:

 

adraper_0-1702305214850.png

 

adraper_1-1702305248353.png

I have tried "Get all file metadata" set to both Yes and No, with the same results.

 

It is a very simple workflow. The file content I am sending over looks like this:

adraper_2-1702305297748.png

 

However when it gets to the server it looks like this:

adraper_3-1702305335716.png

 

I am assuming that it converts the content to bytes but does not convert it back to text. I am confused that the other workflow was not modified but when I did a test run it yielded the exact same results. I am concerned that both are not working properly. Is there anything I am missing? 

  • ericmabkv Profile Picture
    12 on 25 Jun 2024 at 16:52:01
    Re: SFTP file from email attachment

    Hello,

     

    I am having this same issue and would appreciate if you could provide a bit more detail as to how to use the expression base64ToBinary.  I am new to Power Automate and cannot figure out how to use the base64ToBinary expression.  Thank you!

  • adraper Profile Picture
    2 on 11 Dec 2023 at 16:22:18
    Re: SFTP file from email attachment

    That worked great, thanks!

  • Verified answer
    Paulie78 Profile Picture
    8,407 Super User 2025 Season 1 on 11 Dec 2023 at 15:22:56
    Re: SFTP file from email attachment

    You need to use the expression base64ToBinary on the attachment content:

     

    Base64toBinary 

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,745 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,091 Most Valuable Professional

Leaderboard
Loading started