Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: iFtpCmd RETR Crash GPF Hang Windows 7 32-bit WinInet
;RETR ; Syntax: RETR remote-filename ; Begins transmission of a file from the remote host. Must be preceded by either a PORT command or a PASV command to indicate where the server should send data. If WinMetrics(-2) == 3 Then AddExtender("WWINT64I.DLL") ; 64-bit Else AddExtender("WWINT44I.DLL") ; 32-bit FTP_Site = "www.myftpserver.com" FTP_Username = "Fred" FTP_Password = "****" FTP_DIR = '/usr/home/fred/' remotefile = 'Biglist.txt' ;Create Connection tophandle=iBegin(0,"","") conhandle=iHostConnect(tophandle, FTP_Site, @FTP, FTP_Username, FTP_Password) If conhandle==0 Pause("ERROR: Unable to connect to host ",iGetResponse()) Exit EndIf ;*************************************************************************** ;** ;** CWD command ;** ;*************************************************************************** ;CWD command cmdhandle=iFtpCmd(conhandle,"CWD",FTP_DIR,@BINARY) Display(2,'CWD',iGetResponse()) If cmdhandle==0 err=iGetResponse() Message("iFtpCmd Error",err) iClose(cmdhandle) iClose(conhandle) iClose(tophandle) Exit EndIf ;*************************************************************************** ;** ;** PASV command ;** ;*************************************************************************** cmdhandle=iFtpCmd(conhandle,"PASV","",@BINARY) Display(2,'PASV',iGetResponse()) If cmdhandle==0 err=iGetResponse() Message("iFtpCmd Error",err) iClose(cmdhandle) iClose(conhandle) iClose(tophandle) Exit EndIf ;*************************************************************************** ;** ;** LIST command iReadData ;** ;*************************************************************************** cmdhandle=iFtpCmd(conhandle,"LIST","",@BINARY) Display(2,'LIST',iGetResponse()) If cmdhandle==0 err=iGetResponse() Message("iFtpCmd Error",err) iClose(cmdhandle) iClose(conhandle) iClose(tophandle) Exit EndIf iReadData( cmdhandle, DirScript():'list.txt' ) Pause('LIST - iReadData',FileGet(DirScript():'list.txt')) iClose(cmdhandle) ;*************************************************************************** ;** ;** PWD command ;** ;*************************************************************************** ; cmdhandle=iFtpCmd(conhandle,"PWD","",@BINARY) Pause('PWD',iGetResponse()) If cmdhandle==0 err=iGetResponse() Message("iFtpCmd Error",err) iClose(cmdhandle) iClose(conhandle) iClose(tophandle) Exit EndIf ;*************************************************************************** ;** ;** RETR command ;** ;*************************************************************************** ; cmdhandle=iFtpCmd(conhandle,"RETR",remotefile,@BINARY) Message("iGetResponse()", iGetResponse()) If cmdhandle==0 err=iGetResponse() Message("iFtpCmd Error",err) iClose(cmdhandle) iClose(conhandle) iClose(tophandle) Exit EndIf ;Find and delete local file If FileExist(DirScript():remotefile) Then FileDelete(DirScript():remotefile) ;Read RETR results into local file iReadData( cmdhandle, DirScript():remotefile ) ;Clean up FileDelete(DirScript():'list.txt');Delete LIST results iClose(cmdhandle) iClose(conhandle) iClose(tophandle)
Article ID: W17617
Filename: iFtpCmd RETR Crash on Windows 7 32-bit WinInet Only.txt
File Created: 2012:01:25:11:04:56
Last Updated: 2012:01:25:11:04:56