상세 컨텐츠

본문 제목

Delphi Indy Ftp File Exists - Apps

카테고리 없음

by mairagesal1976 2020. 3. 1. 15:21

본문

Hi there Rogerio,I don't have much time to test the code in a machine with Delphi, but with Indy10, resume support is built-in.Check out the Put command, where the 3rd parameter (AApend) is a Boolean value. Set that to True, and it will auto resume.if. the FTP server supports resuming.So, all you need to do is to do something like:varF: TFileStream;DoResume: Boolean;iSize: Integer;beginDoResume:= False;F:= TFileStream.Create('Somefi le.dat', fmOpenRead or fmShareDenyNone);trywith idFTP1 dobegin// code for connecting to FTP Server goes here.iSize:= Size('Somefile.dat');if (iSize  -1) and (F.Size  iSize) then// if the file already exists, and the destination file is smaller, check if we want to resumeif CanResumeDoResume:= MessageDlg('FTP Server supports Resume. Do you want to resume the previous transfer?' ,mtConfirmation, mbYes, mbNo, 0) = mrYes;Put(F, 'Somefile.dat', DoResume);end;finallyF.Free;end;end;DragonSlayer. Hi DragonSlayer.I have tried that. Using a filename as the first parameter the entire file would be appended no to destination file, and not only the missing part.

FreeDelphi indy ftp file exists - apps for pcFtp

I also tried using a Stream (as in your example). That worked, but the destination file would always be incomplete (a few kbytes short).So I've changed to ICS FTPCli component. It's free and I've found a resume upload example that works!

Delphi Indy Ftp File Exists - Apps Download

I have already implemented it on my application and it is working great!Thank you for help anyway.Rogerio.