Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

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

Rockwell

Re: Ignore folder structure when copying the files.

Hey Martin! I could load the extension into the WinSCP but can't figure how to run this to the actual synchronization.
martin

Re: Ignore folder structure when copying the files.

You can write a simple PowerShell script for that.
We have an example for download:
https://winscp.net/eng/docs/script_download_files_to_same_folder

Upload would be similar.

Actually, this code will do what you want:
https://winscp.net/eng/docs/library_example_moves_files_keeping_directory_structure#upload_powershell
If you modify it to:
1) replace $remoteFilePath with $remotePath in the $session.PutFiles call
2) remove if (!($session.FileExists($remoteFilePath))) { $session.CreateDirectory($remoteFilePath) }

It's just unnecessarily complicated for your simpler needs.
On the other hand, it's prepared to be used as a WinSCP extension, so it can be installed into WinSCP GUI.
https://winscp.net/eng/docs/extension

For a simple code, see
https://stackoverflow.com/q/43716807/850848
macservice123

Ignore folder structure when copying the files.

Hello,

Is it possible to ignore local directory file structure when copying files?
Let's say we've got a couple of files in subdirectories as follows:
./testa00.txt 

./testb00.txt
./01/testa01.txt
./01/testb01.txt
./02/testa02.txt
./02/testb02.txt


Is there a way to put those 'testa*.txt' files on FTP server without copying the folder structure. Ideally, I would like all the files to be dropped into a single folder on the FTP server, is there a way to do it?

Thanks
Cristiano