DEV Community

loading...

FTP - Upload files without folder structure

catur_hida_yat profile image Catur Meong ・1 min read

Hi all

previously apologize if my question is not related to programming.

case:
I have some files. all divided into several month folders.
I plan to upload files via FTP, but without the folder structure. inside the FPT folder will only have files that exist in some local folders.

src :

MyFolder

# Jan
    - File Jan 1
    - File Jan 2
# Feb
    - File Feb 1
    - File Feb 2
# Mar
    - File Mar 1
    - File mar 2
# Apr
    - File Apr 1
    - File Arp 2

Dest / FTP Folder:

MyFolder

- File Jan 1
- File Jan 2
- File Feb 1
- File Feb 2
- File Mar 1
- File mar 2
- File Apr 1
- File Arp 2

is there an FTP app that can do that?

Discussion (4)

pic
Editor guide
Collapse
moopet profile image
Ben Sinclair • Edited

Something like for f in $(find . -type f); do curl -T $f ftp://ftp.my-site.example/com/my-path/ --user jeff:jeffspassword; done would probably do what you want if you absolutely must, but like Dian says... don't.

Collapse
catur_hida_yat profile image
Catur Meong Author

Okay, thanks for the feedback

Collapse
dmfay profile image
Dian Fay

You want rsync. ftp should be avoided in general as it's insecure -- use sftp or, even better, scp.

Collapse
catur_hida_yat profile image
Catur Meong Author

for now, I use WInSCP.
it looks like there is no "rsync" feature.