Загрузка файла до 5 мб на сервер.
procedure TForm1.SpeedButton1Click(Sender: TObject);
var
s: String;
F: File of byte;
Size: Integer;
rande:Integer;
i:integer;
begin
if idFTP1.Connected then
if openDialog1.Execute then
begin
OpenDialog1.FileName;
AssignFile(F, OpenDialog1.FileName);
Reset(F);
Size:=Filesize(F);
Label1.Caption := IntToStr(Size)+' байт';
CloseFile(F);
end;
if Size < 5242880 then
begin
rande := Random(712);
idFTP1.Put(OpenDialog1.FileName,inttostr(rande)+'_'+extractfilename(opendialog1.filename),true);
Memo1.Lines.Add ('http://сайт/file/'+inttostr(rande)+'_'+extractfilename(opendialog1.filename));
idFTP1.Connected;
ListBox1.Items.Clear;
idFTP1.List;
for i := 2 to idFTP1.DirectoryListing.Count-1 do
ListBox1.Items.Add(idFTP1.DirectoryListing.Items[i].FileName);
end
end;