Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Adobe Classic SFTP Activity

Avatar

Avatar
Affirm 5
Level 3
adithyacs86
Level 3

Likes

22 likes

Total Posts

110 posts

Correct Reply

5 solutions
Top badges earned
Affirm 5
Validate 10
Validate 1
Give Back 5
Give Back 3
View profile

Avatar
Affirm 5
Level 3
adithyacs86
Level 3

Likes

22 likes

Total Posts

110 posts

Correct Reply

5 solutions
Top badges earned
Affirm 5
Validate 10
Validate 1
Give Back 5
Give Back 3
View profile
adithyacs86
Level 3

21-01-2020

Hi Team, 

 

When i transfer (either download or upload) the files from 3rd party server to Adobe app server folders, we see that files gets appended with the timestamp at the end of the file. 

ex :- Starting transfer of 'sftp://sftp.test.com:portnumber//ftp/foldername/filename.csv' to 'filename_202001...a.csv'

But i dont want the file name to be changed or altered by including the timestamps to it. 

 

Please let me know if there is a way to restrict the suffix of timestamp to the file names. 

 

Thanks,
Adithya

Adobe Campaign Classic

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Springboard
MVP
Florian_Courgey
MVP

Likes

93 likes

Total Posts

87 posts

Correct Reply

19 solutions
Top badges earned
Springboard
Validate 1
Establish
Contributor
Ignite 1
View profile

Avatar
Springboard
MVP
Florian_Courgey
MVP

Likes

93 likes

Total Posts

87 posts

Correct Reply

19 solutions
Top badges earned
Springboard
Validate 1
Establish
Contributor
Ignite 1
View profile
Florian_Courgey
MVP

21-01-2020

Hi,

 

The only fix we found was to add a Javascript activity after the SFTP activity, with the below code:

 

var f = new File(vars.filename); // vars.filename will be automatically set by the previous SFTP activity
logInfo('Old path:', f.fullName); // log full path
var newPath = f.path + f.name.replace(/_\d{14}[a-z]+(\.\w+)$/, '$1'); // generate new path by replacing "{an underscore}{14 digits}{a few lowercase letters}" by nothing
logInfo('New path:', newPath);
f.renameTo(newPath); // move file to the new path
vars.filename = newPath; // set ACC standard filename convention to the new name

 

This is not elegant but it works well. You may encapsulate it into a function in a Javascript code and call it from within your workflow.

 

The "File" doc can be found at https://final-docs.campaign.adobe.com/doc/AC/en/jsapi/c-File.html

Answers (0)