请问怎么用idHttp的POST上传一个文件到服务器上?
procedure TForm1.Button4Click(Sender: TObject);
var
Source: TMemoryStream;
Response: TStringStream;
begin
Response := TStringStream.Create('');
Source:= TMemoryStream.Create;
Source.LoadFromFile('c:/11.doc');
IdHTTP1.Post('http://192.168.0.1/temp/temp.doc', Source, Response);
end;
为什么不行,高手请解决。谢谢~~~~~~~~~~~~~``````
procedure TForm1.Button4Click(Sender: TObject);
var
Source: TMemoryStream;
Response: TStringStream;
begin
Response := TStringStream.Create('');
Source:= TMemoryStream.Create;
Source.LoadFromFile('c:/11.doc');
IdHTTP1.Post('http://192.168.0.1/temp/temp.doc', Source, Response);
end;
为什么不行,高手请解决。谢谢~~~~~~~~~~~~~``````
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货