DEV Community

Catur Hidayat
Catur Hidayat

Posted on

FTP - Upload files without folder structure

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
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

is there an FTP app that can do that?

Top comments (4)

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
 
brokylabs profile image
Catur Hidayat

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
 
brokylabs profile image
Catur Hidayat

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