Welcome, Guest
Username: Password: Remember me
Components and Libraries for Networking Development, discussions, problems and suggestions
  • Page:
  • 1

TOPIC:

Synapse FTP StoreFile 11 years 8 months ago #3390

  • ExDatis
  • ExDatis's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 110
  • Thank you received: 9
Hi there. I tried to upload file to an FTP server, but to no avail. The connection is fine, picture is there, no errors, but the picture is not uploaded on the server. What is wrong?
var
FTP: TFTPSend;
success : Boolean;
begin
// ftp
FTP := TFTPSend.Create;
try
FTP.TargetHost := 'localhost';
//FTP.TargetPort := '21';
FTP.UserName := 'user';
FTP.Password := 'password';
FTP.Login; //ok
FTP.CreateDir('/my_path/ftp_test');//ok
//FTP.Logout;
FTP.ChangeWorkingDir('/my_path/ftp_test'); //everything is ok
except
on E : Exception do
begin
ShowMessage(E.Message);
Exit;
end;
end;

picture_name:= 'picture_file';//ok
with FTP do
begin
//ShowMessage(FTP.GetCurrentDir + '/' + picture_name);//ok
FTP.DirectFileName:= picture_name;
FTP.DirectFile:= True;
success:= FTP.StoreFile(curr_picture, False);// same with True
if success then
ShowMessage('Ok')
else
ShowMessage('Grrrr...');//Grrrrrrrrrrrrrrrrrrr.... :S
end;

FTP.Logout;
FTP.Free;
end;

Synapse, openSuSe 12.2, vsftpd(ftp), CT4.0 32
Thanks!

Please Log in or Create an account to join the conversation.

Synapse FTP StoreFile 11 years 8 months ago #3391

  • ExDatis
  • ExDatis's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 110
  • Thank you received: 9
Works well with Indy(IdFTP)!
---
IdFTP1.Username:= 'user_name';
IdFTP1.Host:= 'localhost';
IdFTP1.Password:= 'user_pwd';
IdFTP1.Connect;
IdFTP1.MakeDir('/some_path/indy_pictures');
IdFTP1.ChangeDir('/some_path/indy_pictures');
IdFTP1.Put('/image_path/Img_name.jpg');
IdFTP1.Disconnect; :cheer:
---
Success!

Please Log in or Create an account to join the conversation.

Last edit: by ExDatis.

Synapse FTP StoreFile 11 years 8 months ago #3392

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4535
  • Thank you received: 1114
We updated pl_Synapse Source from SVN Rev 181
has a lot of changes...
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

Synapse FTP StoreFile 11 years 8 months ago #3393

  • ExDatis
  • ExDatis's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 110
  • Thank you received: 9
Thank you very much sir!
p.s. BigChimp, Lazarus forum, said that(same code) works on his(Win)PC.

Please Log in or Create an account to join the conversation.

  • Page:
  • 1