Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Download files and append new value to the existing name

It's not possible to add a prefix, when downloading the files selected using a file mask.
You would have to retrieve the file list (Session.ListDirectory) and download the files one by one.
Or change the naming strategy to add a suffix instead.
stijacicn

Download files and append new value to the existing name

Hello,

I need your help.. I have made a PS script which is working just fine, but now I would like to add today date into a file name... For example files that I am downloading are named test1.zip, test2.zip, etc... and for bulk download I am using in
$FilesToRetrieve = "test*.zip"
$transferResult = $session.GetFiles($FilesToRetrieve, $DestinationPath, $False, $transferOptions)

For Destination path I am assigning following value: "C:\Downloads\20200903_*"
and this is working, but not in a nice way and I am not able to find why... it assigns new value (date) but it cuts off old name, so for example it place new name like 20200903_st.zip
Hope that I explained well... Thanks in advance!
Regards,
Nikola