web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Power Automate SFTP-SS...
Power Automate
Answered

Power Automate SFTP-SSH multiple dots in filename problems (filename was not the issue in the end)...

(0) ShareShare
ReportReport
Posted on by 18

Hi.

Thanks for providing this forum which I've used a lot but never before posted to.

I'm trying to use Create File Action of the SFTP-SSH connector to upload a file to a SFTP server.

The filename is in the format "xxxxxxxxxxxx.xx.YYYY-MM-DD.xxx" where x is just a normal character.

The filename can be delivered and processed by the SFTP server fine when dropped manually via a FTP client application such as CuteFTP. However when using the SFTP-SSH Create File action in Power Automate it gives an error because it thinks the first part of the filename up to the first dot is a directory folder I believe.

I've tried using a backslash to escape code the dot using the replace() function: 

 
concat(replace(triggerOutputs()?['body/{Name}'], '.', '\.'),'.inc')
 

however that just appears as "xxxxxxxxxxxx\\.xx\\.YYYY-MM-DD.inc" in the resultant filename and isn't processed by the SFTP server. (Interestingly it adds a second backslash to the single one I added). Power Automate SFTP-SSH thinks it's delivered the file correctly though from it's perspective, no errors.

 

I think the entire filename needs to be in brackets or quotes or something but I haven't figured out exactly what yet. I've tried single quotes around the whole name but it comes back with an error 

H_u_g_h_0-1687432733695.png

Can anyone help with ideas on how to properly handle this issue? 

Many thanks in advance.

Hugh

Categories:
I have the same question (0)
  • H_u_g_h Profile Picture
    18 on at

    Actually it seems that the file is actually being delivered and processed ok at the SFTP server side. However the SFTP-SSH connector perhaps isn't always getting back the expected result and is presenting an error. Sometimes it works fine, other times it errors. Each time though the file is delivered and processed correctly.

    Really unsure why at this stage although I'll continue to examine the data and see if anything jumps out.

     

    Thanks,

    Hugh

  • H_u_g_h Profile Picture
    18 on at

    Still not there yet. Tried /SFTPWithSsh/ as the reference to the root folder, as that;s what appears in the server file structure, however no joy. Thought it had worked but now gives Bad Gateway which is a very ambiguous error.

    The filename is not the issue though, as it works fine when creating the file in any subfolder other than the root.

  • Verified answer
    H_u_g_h Profile Picture
    18 on at

    The problem is actually at the SFTP server side. There is a process that happens as soon as a file is delivered to the root folder, that immediately moves it elsewhere for subsequent processing. The issue is one of timing, and the MS SFTP-SSH connector reports an error due to the file immediately being moved. This has been tested and proved in a separate Red Hat linux server where a script runs and moves the file on delivery to another folder. It reports exactly the same error of "path does not exist".

    I'll need to see if there's any option to delay the start of the file processing by a second or 2.

    Hope someone finds this useful info.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard