How to edit file from ftp?

I fave ftp server with file aaa.txt
i want to read number from file and directly change it
is it posible and how?
selasAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sakuya_suCommented:
FTP does not allow files to be changed directly, if the server is linux, you can setup Shell access which will allow file changes.

otherwise you have to download the file, modify it and reupload
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
BlackTigerXCommented:
right, you can't change files through ftp, if you're trying to achieve that there can be many other options, depending on how much control you have over the server, if you can install a service on that server, perhaps, you could expose some functions to allow you to modify files on the server, othewise, as sakuya_su mentions, you have to download the file, modify it, and upload it
0
Eddie ShipmanAll-around developerCommented:
I would download it into a stream update it and then reupload it.

procedure TForm1.Button1Click(Sender: TObject);
var
  ss: TStringStream;
  sl: TStringList;
begin
  ss := TStringStream.Create('');
  sl := TStringList.Create;
  try
    IdFTP1.Connect;
    IdFTP1.ChangeDir('/public_html');
    IdFTP1.Get('test.txt', ss);
    ss.Position := 0;
    sl.Text := ss.Datastring;
    if sl.Count > 0 then
      sl[0] := 'This line changed';
  finally
    if sl.Count > 0 then
    begin
      sl.SaveToStream(ss);
      IdFTP1.Put(ss, 'test.txt');
    end;
    ss.Free;
    sl.Free;
  end;
end;
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.