const URL_POST = 'http://localhost/gate/gate.php'; ... procedure POSTFile(Filename: String); var IdHTTP: TIdHTTP; LPostStream: TIdMultiPartFormDataStream; LResultString: String; ff: TFileStream; begin IdHTTP := TIdHTTP.Create(nil); IdHTTP.MaxLineLength := 0; LPostStream := TIdMultiPartFormDataStream.Create; ff := TFileStream.Create(Filename, 0); try LPostStream.AddObject('data', 'application/vnd', ff, Filename); try LResultString := IdHTTP.Post(URL_POST, LPostStream); except on E:Exception do Showmessage(E.Message); end; ShowMessage(LResultString); finally IdHTTP.Free; LPostStream.Free; end; end;