unix FTPS cURL Directory Creation Failed

109 views Asked by At

I want to create a folder on a FTPS and then upload a file into that newly created folder. Please can anyone help me out?

Below is a truncated script I am using

ftp_resp=`#lftp <
                         curl <<EOF --ftp-create-dirs  & ${ordernumber} & -T "${l_source_folder_v}/Write/$base_name" & -v -k --ftp-ssl-reqd ftp://ftps.mydomain.com -u $l_username_v:$l_password_v; 

            #set net:timeout 10; set net:max-retries 3; set net:reconnect-interval-base 5; set net:reconnect-interval-multiplier 1;set ftps:initial-prot "";  set ftp:ssl-force true;  set ftp:ssl-protect-data true;
            #put ${l_source_folder_v}/Write/$base_name;
            #bye

EOF`

My problem is where in the script to create the folder and then upload the file subsequently.

Thank you!

1

There are 1 answers

0
TEKA On BEST ANSWER

I found a way to create the directory and upload a file into this newly created directory by this code below

curl -v -k --ftp-create-dirs --ftp-ssl-reqd ftp://ftps.mydomain.com/yourfoldername/ -u $l_username_v:$l_password_v -T "path_of_the_file/newfile.txt";