S
shuaikiller
Unregistered / Unconfirmed
GUEST, unregistred user!
利用ICS的THttpCli上传文件?经过与Indy的代码对比还是要提问下,请朋友们指点下! asp.net程序: <input type="upfile" id="MyFile" runat="server" />...private void Page_Load(object sender, System.EventArgs e){ if(MyFile.PostedFile!=null) { string strSaveDir = "./upload/"; string strName = MyFile.PostedFile.FileName; int intPath = strName.LastIndexOf("//"); string strNewName = strName.Substring(intPath); MyFile.PostedFile.SaveAs(Server.MapPath(strSaveDir + strNewName)); }}在Indy中可以进行: MutPartForm := TIdMultiPartFormDataStream.Create; ... IdHTTP.Request.ContentType := MutPartForm.RequestContentType; MutPartForm.AddFile('upfile', fileName, 'jpg'); MutPartForm.Position := 0; aIdHTTP.Post(URL, MutPartForm,ResponseStream); ... 问题: 如何运用ICS的THttpCli上传文件?