[twsocket] Ftp freezing
I am using tftpcli in passive mode to upload files, while uploading a file, for some reason if a connection problem occurs in the middle of the transfer, the program freezes , to overcome this problem I thought that I can, - Create a thread to make the ftp transfer - Assign OnProgress event, and in this event handler PostMessage to the main application window, - In main thread if message from thread does not come for long time, kill the thread and restart the uploading by creating another thread instance. Is this approach is a proper solution or what would you suggest? Best Regards, -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Ftp-file corruption check
thanks for your kind reply, but if I go with the stable version of the ICS which does not have XCRC command support, I used the following code to achieve my aim (recommended by FPiette), 1- upload file using ftpPutAsync() 2- use ftpDirAsync() and check the size of the file of interest if it is same on the local machine and on the remote machine. I used the following pseudo code: procedure ftpRequestDone(); begin case RqType of ftpTypeSetAsync(): Begin ftpCli.HostFileName:= '2.bin'; ftpCli.LocalFileName:= 'c:\2.bin'; ftpCli.HostDirName:= '/'; . ftpCli.PutAsync(); End; ftpPutAsync: Begin ftpCli.HostFileName:= '2.bin'; ftpCli.LocalFileName:= ''; ftpCli.HostDirName:= '/'; ftpCli.LocalStream:= TMemoryStream.Create(); ftpCli.DirAsync(); End; ftpDirAsync: Begin ftpCli.LocalStream.Position:= 0; SetLength(tempStr, ftpCli.LocalStream.Size); {Get the directory response of the server into tempStr string.} CopyMemory(Pointer(tempStr)^, TMemoryStream(ftpCli.LocalStream).Memory, ftpCli.LocalStream.Size); if(Pos(FileSizeInString, tempStr)0) then ShowMessage('Uploaded Correctly') else showMessage('upload failure'); End; ... end; end; but the problem with this code is; the server returns the whole directory content (losts of file) but I only want to get the directory listing for the specified file, to do that I used ftpCli.HostFileName:= '2.bin'; before calling ftpcli.DirAsync() but it did not work. Is there anyway to get the directory listing for the only specified file? best regards, Thanks Arno Garrels [EMAIL PROTECTED] wrote: New Era wrote: How to check if a file is either uploaded correctly or not, I know that ftpCli supports MD5 command, but at the outside world there were no commercial ftp hosting services that support MD5 command, I only found one ftp hosting which supports XCRC and this is command as far as I know, is not supported by ftpCli. (I am trying to build an ftp client that is to be used to upload files to external ftp host.) Aug 06, 2006 V2.107 Angus [SNIP] added XCRC command to get CRC32 for file (for servers without MD5) So get latest ICS-Beta, it's in both V5 and V6 -- Arno Garrels [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be - Yahoo! Answers - Get better answers from someone who knows. Tryit now. -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
[twsocket] Ftp-file corruption check
How to check if a file is either uploaded correctly or not, I know that ftpCli supports MD5 command, but at the outside world there were no commercial ftp hosting services that support MD5 command, I only found one ftp hosting which supports XCRC and this is command as far as I know, is not supported by ftpCli. (I am trying to build an ftp client that is to be used to upload files to external ftp host.) - For ideas on reducing your carbon footprint visit Yahoo! For Good this month. -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
[twsocket] ftpcommon.pas
Could anyone that uses this unit provide a sample app. to me Thanks. Send instant messages to your online friends http://uk.messenger.yahoo.com -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] FtpCommon.pas (Davie' s code)
My real name is Metin Tikves an MSc student in computer engineering. Does this code works properly for all the servers?. I mean the parsing will be OK on the server response regardless of the type of the software running on the server...? Thanks Arno Garrels [EMAIL PROTECTED] wrote: New Era wrote: Anbody having the FtpCommon.pas (to parse the ftp listing) could send it to me ... If you tell us your real name, I send it to you. --- Arno Garrels [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html Thanks - Try the all-new Yahoo! Mail . The New Version is radically easier to use - The Wall Street Journal -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be - Next-generation email? Now you can have it with All New Yahoo! Mail. -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
[twsocket] FtpCommon.pas (Davie' s code)
Anbody having the FtpCommon.pas (to parse the ftp listing) could send it to me ... Thanks - Try the all-new Yahoo! Mail . The New Version is radically easier to use The Wall Street Journal -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] FtpCli upload problem
Thanks for the tip but could not get the FtpCommon.pas, it is not on the Davie's web site (deadlink). If you have, could you post it to me thanks.. Fastream Technologies [EMAIL PROTECTED] wrote: Then I think you have no other choice then issuing a LIST and parsing the folder listing with Davie's code. Regards, SZ - Original Message - From: New Era To: ICS support mailing Sent: Tuesday, October 03, 2006 10:13 AM Subject: Re: [twsocket] FtpCli upload problem : Hi, if server does not support SIZE, MD5 then what is the best way to make that check? : : Arno Garrels wrote: New Era wrote: : Thanks for the reply and advice, : I looked at the component again it contains a property if I am not : wrong isSent or named with a similiar name. Looked the property in : the source code, it also checks the status against 226 and with : other some constants. Anyway I will do the check you suggested : : In the FTP size of an upload is unknown to the server. The server : assumes success when the client closes the data channel gracefully. : So a file may have been corrupted even though you got an OK response. : The client is responsible to check whether both local and remote : files are the same either by comparing their size or more reliable : by comparing their MD5 checksum (command MD5). Unfortunately MD5 is : not supported on every server. : : --- : Arno Garrels [TeamICS] : http://www.overbyte.be/eng/overbyte/teamics.html : : : : : : : Dan wrote: Not sure why it happens, but to : guard against this I would do a SIZE command on the remote file after : uploading it, then check if it matches the local file size before : deleting it. SIZE is supported by every FTP server I have used, : although I'm not sure if its in the initial FTP RFC. : : Dan : : -Original Message- : From: [EMAIL PROTECTED] [mailto:twsocket- : [EMAIL PROTECTED] On Behalf Of New Era : Sent: 21 September 2006 12:10 : To: twsocket@elists.org : Subject: [twsocket] FtpCli upload problem : : : [input] [input] [input] [input] : : I am using the following code in the FtpRequestDone event handler; : : case RqType of : ... : : : ftpPutAsync: begin : if(FtpCli.StatusCode= 226) then Delete(FileName); : : end; : : : end; : What I am trying to do is to upload a file to server then delete the : local file. In fact this code is working for the many cases but there : are a few cases where the server says that uploaded files (local file : sizes are greater than 0 bytes) are zero bytes length and the : localfile is deleted. What is wrong? I am using passive mode. : : thanks. : : : - : Try the all-new Yahoo! Mail . The New Version is radically easier : to use - The Wall Street Journal : -- : To unsubscribe or change your settings for TWSocket mailing list : please goto http://www.elists.org/mailman/listinfo/twsocket : Visit our website at http://www.overbyte.be : : : -- : To unsubscribe or change your settings for TWSocket mailing list : please goto http://www.elists.org/mailman/listinfo/twsocket : Visit our website at http://www.overbyte.be : : : : - : All new Yahoo! Mail The new Interface is stunning in its simplicity : and ease of use. - PC Magazine : -- : To unsubscribe or change your settings for TWSocket mailing list : please goto http://www.elists.org/mailman/listinfo/twsocket : Visit our website at http://www.overbyte.be : : : : - : Yahoo! Messenger NEW - crystal clear PC to PC calling worldwide with voicemail : -- : To unsubscribe or change your settings for TWSocket mailing list : please goto http://www.elists.org/mailman/listinfo/twsocket : Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be - The all-new Yahoo! Mail goes wherever you go - free your email address from your Internet provider. -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] FtpCli upload problem
Hi, if server does not support SIZE, MD5 then what is the best way to make that check? Arno Garrels [EMAIL PROTECTED] wrote: New Era wrote: Thanks for the reply and advice, I looked at the component again it contains a property if I am not wrong isSent or named with a similiar name. Looked the property in the source code, it also checks the status against 226 and with other some constants. Anyway I will do the check you suggested In the FTP size of an upload is unknown to the server. The server assumes success when the client closes the data channel gracefully. So a file may have been corrupted even though you got an OK response. The client is responsible to check whether both local and remote files are the same either by comparing their size or more reliable by comparing their MD5 checksum (command MD5). Unfortunately MD5 is not supported on every server. --- Arno Garrels [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html Dan wrote: Not sure why it happens, but to guard against this I would do a SIZE command on the remote file after uploading it, then check if it matches the local file size before deleting it. SIZE is supported by every FTP server I have used, although I'm not sure if its in the initial FTP RFC. Dan -Original Message- From: [EMAIL PROTECTED] [mailto:twsocket- [EMAIL PROTECTED] On Behalf Of New Era Sent: 21 September 2006 12:10 To: twsocket@elists.org Subject: [twsocket] FtpCli upload problem [input] [input] [input] [input] I am using the following code in the FtpRequestDone event handler; case RqType of ... ftpPutAsync: begin if(FtpCli.StatusCode= 226) then Delete(FileName); end; end; What I am trying to do is to upload a file to server then delete the local file. In fact this code is working for the many cases but there are a few cases where the server says that uploaded files (local file sizes are greater than 0 bytes) are zero bytes length and the localfile is deleted. What is wrong? I am using passive mode. thanks. - Try the all-new Yahoo! Mail . The New Version is radically easier to use - The Wall Street Journal -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be - All new Yahoo! Mail The new Interface is stunning in its simplicity and ease of use. - PC Magazine -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be - Yahoo! Messenger NEW - crystal clear PC to PC calling worldwide with voicemail -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] FtpCli upload problem
Thanks for the reply and advice, I looked at the component again it contains a property if I am not wrong isSent or named with a similiar name. Looked the property in the source code, it also checks the status against 226 and with other some constants. Anyway I will do the check you suggested Dan [EMAIL PROTECTED] wrote: Not sure why it happens, but to guard against this I would do a SIZE command on the remote file after uploading it, then check if it matches the local file size before deleting it. SIZE is supported by every FTP server I have used, although I'm not sure if its in the initial FTP RFC. Dan -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of New Era Sent: 21 September 2006 12:10 To: twsocket@elists.org Subject: [twsocket] FtpCli upload problem [input][input][input][input] I am using the following code in the FtpRequestDone event handler; case RqType of ... ftpPutAsync: begin if(FtpCli.StatusCode= 226) then Delete(FileName); end; end; What I am trying to do is to upload a file to server then delete the local file. In fact this code is working for the many cases but there are a few cases where the server says that uploaded files (local file sizes are greater than 0 bytes) are zero bytes length and the localfile is deleted. What is wrong? I am using passive mode. thanks. - Try the all-new Yahoo! Mail . The New Version is radically easier to use - The Wall Street Journal -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be - All new Yahoo! Mail The new Interface is stunning in its simplicity and ease of use. - PC Magazine -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
[twsocket] FtpCli upload problem
[input][input][input][input] I am using the following code in the FtpRequestDone event handler; case RqType of ... ftpPutAsync: begin if(FtpCli.StatusCode= 226) then Delete(FileName); end; end; What I am trying to do is to upload a file to server then delete the local file. In fact this code is working for the many cases but there are a few cases where the server says that uploaded files (local file sizes are greater than 0 bytes) are zero bytes length and the localfile is deleted. What is wrong? I am using passive mode. thanks. - Try the all-new Yahoo! Mail . The New Version is radically easier to use The Wall Street Journal -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
[twsocket] File Upload FtpCli
I am using the following code in the FtpRequestDone event handler; case RqType of ... ftpPutAsync: begin if(FtpCli.StatusCode= 226) then Delete(FileName); end; end; What I am trying to do is to upload a file to server then delete the local file. In fact this code is working for the many cases but there are a few cases where the server says that uploaded files (local file sizes are greater than 0 bytes) are zero bytes length and the localfile is deleted. What is wrong? I am using passive mode. thanks. - Yahoo! Messenger NEW - crystal clear PC to PC calling worldwide with voicemail -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] 500: PAQSV exception No available PASV ports
So inserting a high value into PasvPortRange may be a solution(start 16384 and PasvPortRange= 4), but if other applications randomly uses ports in this range, what will be the behaviour of the ftpserver I mean, if x application uses port 1 and when ftpserver also wants to open 1, it gets an error, in this error case does it simply increases port number to 16667 or simply fails. Another question is there a simple way under windows to reserve some ports to the use of an application, Could I say to windows that ports 16300-16400 are reserved for ftpserver and do not allow other applications open any port in this range even if ftpserver is not using that port yet?. --- Arno Garrels [EMAIL PROTECTED] wrote: Marc wrote: With what I have see with the time, one port is skip for each transaction. so with the range you have, only 2 transactions can be done. Windows keep the port open for some time, so you come at the end with no more port to do transaction. Well, a closed socket remains in TIME_WAIT state for a while until it is destroyed by Windows, this discussion is not new. But I don't think that those sockets use/block a port while in that state. You can do a simple test, set PortRange to 1 and run the tool TCPView from Sysinternals (it updates the view of open sockets dynamically). Now connect and RETR or NLST to open a data connection in passive mode several times. In TCPView you will see sockets in TIMW_WAIT state however it's no problem to establish a new data connection. I checked that yesterday on W2K. --- Arno Garrels [TeamICS] Even with a bigger range like 100 ports, you can easily come to with no free port just by checking some directory just because this will use a port for each send. The PasvPortRangeStart set the start the max set the max and when the server can't use any port, this give you the No available PASV ports. HTH Marc TYPSoft http://www.typsoft.com At 03:50 2005-11-09 +, you wrote: There is only one client, this client connects to server checks some files and disconnects at some specified intervals(polling). So In this case the number 5 must be sufficient. PasvPortRangeStart is default 16384. Does this means that the application use 16384..16388.. If any port in this range is in use, then application fails or it is exceeds this 16388 limit... I ran ftpserver program, and the clients in passive mode but after a while constantly I am getting No available PASV ports error. -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be ___ Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
[twsocket] 500: PAQSV exception No available PASV ports
I ran ftpserver program, and the clients in passive mode but after a while constantly I am getting No available PASV ports error. I searched the mailing list and saw other comments about the same issue. But no solution yet. I had downloaded the ICS latest version (In the readme txt it has a line saying revised : May 29, 2005), recompiled the source but getting the same error message... I am using the sample application of fpiette, named FtpServ.dpr, I did not any change, Do I have to change some properties, In the example PasvIpAddr is empty, PasvPortRange is 5, Do I have change this properties.. ___ Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
[twsocket] 500: PAQSV exception No available PASV ports
There is only one client, this client connects to server checks some files and disconnects at some specified intervals(polling). So In this case the number 5 must be sufficient. PasvPortRangeStart is default 16384. Does this means that the application use 16384..16388.. If any port in this range is in use, then application fails or it is exceeds this 16388 limit... I ran ftpserver program, and the clients in passive mode but after a while constantly I am getting No available PASV ports error. Sounds very normal in case of 5 clients have data channels open in passive mode and a 6th is trying to establish one. Have you set a larger range (20)? Is it possible that another application uses ports from the specified range? Have you tried to change property PasvPortRangeStart? I searched the mailing list and saw other comments about the same issue. But no solution yet. I had downloaded the ICS latest version (In the readme txt it has a line saying revised : May 29, 2005), recompiled the source but getting the same error message... I am using the sample application of fpiette, named FtpServ.dpr, I did not any change, Do I have to change some properties, In the example PasvIpAddr is empty, PasvPortRange is 5, Do I have change this properties.. ___ Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be