jontebgood
asked on
Recive filestream to local filesystem.
Hi there folks
Im trying to do a FTP server for recive files from a FTP client via a filestream. Im trying to do the ftp server with the indy component. FTPServer.
In the demo they just show how to retrive a file. and i know nothing of how to use tfilestream
It would be nice if u show me how to recive a new file and how to appaend if the file is not completly uploaded yet.
plz help me
Regards
J
Im trying to do a FTP server for recive files from a FTP client via a filestream. Im trying to do the ftp server with the indy component. FTPServer.
In the demo they just show how to retrive a file. and i know nothing of how to use tfilestream
It would be nice if u show me how to recive a new file and how to appaend if the file is not completly uploaded yet.
plz help me
Regards
J
ASKER
Thanks! in the append part... U just check if the file exsists.... if it does but someone have upload it so it is complete`? then it seems to me that the file will be corrupt right?
Regards
Regards
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks...
Best regards
J
Best regards
J
// upload file from client and store (or append) in server
procedure TForm1.IdFTPServer1StoreFi
const AFileName: String; AAppend: Boolean; var VStream: TStream);
begin
ListBox1.Items.Add('Store:
if AAppend and FileExists(AFileName) then
begin
VStream := TFileStream.Create(AFileNa
end
else
VStream := TFileStream.Create(AFileNa
end;
// download file from server to client
procedure TForm1.IdFTPServer1Retriev
const AFileName: String; var VStream: TStream);
begin
ListBox1.Items.Add('Retrie
VStream := TFileStream.Create(AFileNa
end;