httppost Robbanux[SOLVED by Myself ] Very simpel solution... lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- Robert W.B. · 2017-02-05 02:57 I figured it out.This is the way to do it. uses fphttpclient; procedure TForm1.Button1Click(Sender: TObject); Var   Respo: TStringStream;   S : String;//server answer text: String;//my send string begin text:='This text will be sent to the upload server,bla bla bla';//Works great with ssl   With TFPHttpClient.Create(Nil) do     try       Respo:=TStringStream.Create('');       FormPost('https://theserver.com/upload.asp',text,Respo);       S:=Respo.DataString;       showmessage('S='+S);//Check what answer you get from server and voila        Respo.Destroy;     finally       Free;     end; end;  Many thanks to the Lazarus/Freepascal team for fphttpclient . Lazarus/Freepascal rules. ---------------------------------------------------------------------- derek.john.evans · 2017-02-05 07:45 EDIT: Actually, if edtSourceFile.Text is a filename then you are correct. Have you a server ready to receive? OLD MESSAGE: Looks like you are trying to use this method: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TFPCustomHTTPClient.FileFormPost(  const AURL, AFieldName,    AFileName: string;   const Response: TStream);    Except you want to use this: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TFPCustomHTTPClient.FileFormPost(  const AURL: string;   FormData: TStrings;   AFieldName, AFileName: string;   const Response: TStream);       So, you code should be (if edtSourceFile is a TStrings) Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i FileFormPost('http://example.com/upload.php', edtSourceFile, 'PostFilenameParam',Respo);  The fieldparam is used by the server to identify the edtSourceFile data sent. A server expecting this data must be available. Another option is to use a HTTP PUT for a file upload, but again, the server must be expecting your data. ---------------------------------------------------------------------- Leledumbo · 2017-02-06 09:52 Quote from: Bob the Swede on February 06, 2017, 01:32:19 amthe error message says: No data!! this is easy in PHP why not in pascal? This is just as easy but requires you to understand how to use it correctly, just as when you learn it using PHP. AURL is clear, the target URL where the file will be POST-ed toAFieldName is the name attribute as if you write in HTML: AFileName is the path to the file you want to upload where your app will run from, e.g.: /what/ever/this/shit/is.jpgResponse is any TStream descendant instance that will hold the HTTP response body after you execute the functionFormData, if exists, is other fields you would like to send since multipart/form-data also allows more than just a file to be sent