FTP Upload QUIT ???

Dave Cragg dcragg at lacscentre.co.uk
Sat Sep 24 04:21:19 EDT 2005


On 24 Sep 2005, at 08:21, <kevin at stallibrass.com> wrote:

> Thankyou to everyone who has helped me get this far -
>
> I see the following QUIT message when uploading an image file to my
> webserver. The script works fine for text files but when it's an  
> image, the
> QUIT Message appears in my log, the file is created on my webserver  
> but it
> is empty _ 0kb)
>
> My Webserver states that they do not generate the QUIT message so,  
> is REV
> causing this?
>
> 220 ProFTPD 1.3.0rc2 Server (Main FTP Server) [8.3.8.106] USER wash1
> 331 Password required for wash1. PASS <password>
> 230 User wash1 logged in. 257 "/" is current directory. TYPE I 200  
> Type set
> to I PASV
> 227 Entering Passive Mode (8,3,8,106,14,49). STOR /image1.gif
> 150 Opening BINARY mode data connection for /image1.gif QUIT
> 221 Goodbye.
>
> For info, my script
>
> export image "image1" to file "C:/image1.gif" as GIF
> put "ftp://name:pass@ftp.somewhere.com/image1.gif" into myURL
> put "c:/image1.gif" into myFile
> libURLSetLogField the name of field "Logfield"
> libURLftpUploadFile myFile,myURL,"uploadDone"
>
> I've also tried the binfile form of the above with the same problem
> Regards
>
> Kevin Stallibrass
>

Kevin

I wouldn't worry too much about the QUIT command. libUrl does this  
some time after a transaction is completed in order to close the  
session. But your log shows that the transaction didn't complete  
properly.

This is part of the log I see here when using more or less the same  
script as you.

TYPE I
200 Type set to I.
PASV
227 Entering Passive Mode (192,168,1,104,202,83)
STOR /Users/dad/Sites/image1.gif
150 Opening BINARY mode data connection for '/Users/dad/Sites/ 
image1.gif'.
226 Transfer complete.

Your log doesn't show a "226 Transfer complete" entry. This is  
important.

I'd guess that the source file in question might be empty. (It seems  
libUrl doesn't handle this situation too gracefully. I'll check that  
out later.) You could check by altering your script like this:

export image "image1" to file "C:/image1.gif" as GIF
put "ftp://name:pass@ftp.somewhere.com/image1.gif" into myURL
put "c:/image1.gif" into myFile
put url ("binfile:" & myFile) into tImageData
if length(tImageData) is 0 then
   answer "no data"
else
   libUrlFtpUpload tImageData, myURL,"uploadDone"
end if

Cheers
Dave







More information about the use-livecode mailing list