Registriert seit: 10. Jul 2011
45 Beiträge
|
AW: post Upload via Lazarus
27. Jul 2011, 00:52
Delphi-Quellcode:
uses httpsend; //Synapse
function TForm1.UploadFile(Filename:string):TStrings;
var
Data:TFileStream;
FormFields:TStrings;
res:TStrings;
begin
Data:=TFileStream.Create(FileName, fmOpenRead);
FormFields:=TStringList.Create;
FormFields.Add('user='+edit1.text); //<input> oder hidden Values
FormFields.Add('upload=1'); //<input> oder hidden Values
Res:=TStringList.Create;
HttpPostFileForm('http://www.example.com/upload.php',
'FormName', //Name des <form> Feldes
ExtractFileName(FileName),
Data,
FormFields,
res);
result:=res;
Data.Free;
FormFields.free;
end;
Geändert von marcoX (27. Jul 2011 um 00:56 Uhr)
|
|
Zitat
|