Copy just the file

Advertisement

JJacobEMM
Guest

Copy just the file

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

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,453
Location:
Prague, Czechia

Re: Copy just the file

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:

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

Reply with quote

JJacobEMM
Guest

Re: Copy just the file

martin 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:

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?

Reply with quote

Advertisement

You can post new topics in this forum