libURLftpUploadFile & URLStatus
Posted: Wed Jun 20, 2007 3:49 pm
I have issues with uploading multiple files to a server by ftp.
put 1 into counter
repeat with i = 1 to the number of items in ftplist
put false into success
put item i of ftplist into fileName
put "ftp://myserver.mydomain.com/uploads/" & counter into theURL
libURLftpUploadFile fileName, theURL
wait for n seconds
repeat with i = 1 to 120
wait for 0.5 seconds
put URLStatus(theURL) into theURLStatus
if theURLStatus = "uploaded" then
put true into success
exit repeat
end if
end repeat
reportOnFTPSuccess(success)
end repeat
If I debug this and step thorugh it line by line then it works and the files get uploaded with URLStatus returning "uploaded". If I run it with no debugging then URLStatus either returns "connecting" or "" (ie nothing).
Any ideas?
Anyone written something easy to use that ftp's synchronously?
put 1 into counter
repeat with i = 1 to the number of items in ftplist
put false into success
put item i of ftplist into fileName
put "ftp://myserver.mydomain.com/uploads/" & counter into theURL
libURLftpUploadFile fileName, theURL
wait for n seconds
repeat with i = 1 to 120
wait for 0.5 seconds
put URLStatus(theURL) into theURLStatus
if theURLStatus = "uploaded" then
put true into success
exit repeat
end if
end repeat
reportOnFTPSuccess(success)
end repeat
If I debug this and step thorugh it line by line then it works and the files get uploaded with URLStatus returning "uploaded". If I run it with no debugging then URLStatus either returns "connecting" or "" (ie nothing).
Any ideas?
Anyone written something easy to use that ftp's synchronously?