aqui esta el codigo
la variable Stramsize es una variable global de mi unit.
Código Delphi
[-]OpenDialog1.Filter := 'All Files (*.*)'; OpenDialog1.FilterIndex := 1; if OpenDialog1.Execute then
begin
Edit1.Text := ExtractFileName(OpenDialog1.FileName); ClientSocket1.Socket.SendText('FILE!'+Edit1.Text);
sleep(2000); Streamsize := TFileStream.Create(OpenDialog1.FileName, fmopenread); Edit2.Text := inttostr(Streamsize.Size);
Sleep(2000);
ClientSocket1.Socket.SendText('SIZE!'+Edit2.Text); Streamsize.Position := 0;
Streamsize.Free;
sleep(2000);
ClientSocket2.Address := Edit3.Text;
ClientSocket2.Open; if ClientSocket2.Socket.SendStream(TFileStream.Create(OpenDialog1.FileName, fmopenRead)) then memo1.Lines.Add('File Sent');
end;