Http Post with indy

后端 未结 3 813
耶瑟儿~
耶瑟儿~ 2020-12-03 17:55

I have a simple php script on my web server which I need to upload a file using HTTP POST, which I am doing in Delphi.

Here is my code with Indy but aparantely it wo

3条回答
  •  天命终不由人
    2020-12-03 18:22

    You lost 2 characters '--'. It is better to do so:

    http.Request.ContentType:='multipart/form-data;boundary='+myBoundery;
    fname := CRLF + '--' + myBoundery + CRLF + 'Content-Disposition: form-data; name=\"uploadedfile\";filename=\"test.png"' + CRLF;
    

提交回复
热议问题