Upload file via POST

前端 未结 1 597
野趣味
野趣味 2020-12-10 22:59

I have the necessity to implements a file upload on a web server in C++, I succeed with the following code:

  #include 
  #include 

        
相关标签:
1条回答
  • 2020-12-10 23:27

    You shouldn't be using sprintf(buffer,"%s%s\r\n",buffer,content); on binary data. It isn't a string, so %s is wrong.

    You either need to base64 encode it with an appropriate Content-Transfer-Encoding, or use memcpy with a Content-Length header.

    0 讨论(0)
提交回复
热议问题