Hi,
I’ve been trying to use curl in a shell script to put file on an ftp site. So far I can put file on the root directory but I’ve been unable to put the files in any directories that are on the root directory itself. Here’s my code
set ftp_path to "the folder I'm trying to path to"
set ftp_name to "username"
set ftp_pw to "password"
set ftp_server to "ftp address"
set this_file to choose file
set thisPOSIXfile to quoted form of POSIX path of this_file
set shellscript to "curl -u " & ftp_name & ":" & ftp_pw & " -T " & thisPOSIXfile & " " & ¬
ftp_server & ""
do shell script shellscript
I know that in the above script I’m not specifying the ftp_path but I’ve tried to insert it into the shellscript in various places without any success.
Please Help!
Hi jj,
I’ve looked at your link but it was a little indepth for my knowledge, but I managed to get my script to work. In the previos script I was trying to specify the directory using another variable but I found if I just include the directory path on the end of my ftp_server variable it works, simple :o
set ftp_name to "username"
set ftp_pw to "password"
set ftp_server to "ftp address/the path/"
set this_file to choose file
set thisPOSIXfile to quoted form of POSIX path of this_file
set shellscript to "curl -u " & ftp_name & ":" & ftp_pw & " -T " & thisPOSIXfile & " " & ¬
ftp_server & ""
do shell script shellscript