Topic "Copy just the file"

Author Message
JJacobEMM

Guest


Is there a way when putting files from a directory with subdirectory to put only the files in the ftp without the folder structure?

Example

C:\Files\XYZ\June\abc.pdf
C:\Files\XYZ\May\jkl.pdf

I want those files to all go to the same folder in the ftp, however right now it is making a June folder and a May folder.

Is there any way to do this?

Thanks
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
There's no script command to do this.
However it should be relatively simple to write a script (e.g. using PowerShell) to generate a WinSCP script with a one command for each file:

Code:
put C:\Files\XYZ\June\abc.pdf /home/abc.pdf
put C:\Files\XYZ\May\jkl.pdf /home/jkl.pdf
JJacobEMM

Guest


prikryl wrote:
There's no script command to do this.
However it should be relatively simple to write a script (e.g. using PowerShell) to generate a WinSCP script with a one command for each file:

Code:
put C:\Files\XYZ\June\abc.pdf /home/abc.pdf
put C:\Files\XYZ\May\jkl.pdf /home/jkl.pdf


There are more than just 2 puts to be written though.

The goal is the have an automated solution where with a statement like this

put "C:\Files\FolderName\*" -filemask=*2014/June/*.pdf|SENT_*.pdf "/home/FileFolder"

will send all the files from C:\Files\FolderName\SubFolder\Year\Month where it has a 2014\June path in it

ie

Files\XYZ\2014\June\
Files\XYZ\xyz sub\2014\June\
Files\ABC\2014\June

files from those folders will go to /home/filefolder
without the folder structures and without having to create a put for ever folder structure where there are thousands.

Currently it is making a folder structure

fileFolder
-XYZ
--2014
---June
----file
--xyz sub
---2014
----June
-----file2
-ABC
--2014
---June
----file3

where I would want just

fileFolder
-file1
-file2
-file3

Is this not possible?
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License