I am using Delphi 7 personal along with Indy 10.
I have a program that uploads a 7 mb .dat file to a remote server thru ftp. I have my code wrapped into a try/except but for some reason and at some point, the transfer fails, and i get no errors or exceptions whatsoever. I am even getting the message 'dat file uploaded!' to show up.
Only i get a .dat file uploded on the remote server but that hasn't the size of the original one.
I tried uploading the same file manually with my ftpcore, and it worked ok. So i guess there might be something wrong with my code?
here it is :
try if FileExists(myFile) then begin ftp.Host:='xxxxx'; ftp.Username:='xxxxx'; ftp.Password:='xxxxx'; ftp.Port := 21; ftp.Passive := True; ftp.Connect; if FTPFileExists(myFile2) then begin showmessage('remote file exists already!'); end else begin ftp.Put(myFile, '/htdocs/dat/remote_file.dat', true); showmessage('dat file uploaded!'); end; ftp.Disconnect; end; except on E : Exception do begin showmessage('transfer failed'); end; end;
Thanks in advance