indy multipart/form-data
indy multipart/form-data
uses IdMultipartFormData;
procedure TForm1.ToolButton1Click(Sender: TObject); //rest上传文件 var ms: TIdMultiPartFormDataStream; begin if OpenDialog1.Execute then begin ms := TIdMultiPartFormDataStream.Create; ms.AddFormField('filename', '中国'); ms.AddFile('file', OpenDialog1.FileName, ''); url := url + 'restupload'; IdHTTP1.Post(url, ms); ms.Free; end; end;
本文来自博客园,作者:{咏南中间件},转载请注明原文链接:https://www.cnblogs.com/hnxxcxg/p/12572616.html