title: CURLOPT_POSTFIELDS CURL post image file, C language
body: <p>Wonder if anyone has any experience posting image files with CURL in C..?</p>
  
  <p>I am writing a program to post to a facebook Type web service, and everything is going fine, except when I attempt to post image files...</p>
  
  <p>There's a special format that the server needs or it will not accept the post...</p>
  
  <p>something like this:</p>
  
  <p>---webformkitXXXXXXXX\r\n
  filename"somefile.jpg"\r\n</p>
  
  <p>JPEG or IMAGE FILE HERE (in binary) </p>
  
  <p>---webformkitXXXXXXXX\r\n
  END----</p>
  
  <p>So when I am finally able to to memcpy together the different pieces I need,
  I can save it to file, and it looks just fine, but I can see from the packet captures, that CURL doesn't like taking the binary, it appears that it's truncating the buffer at the first sign of a '\0' because, it only sends like 300 bytes, when it should be sending 80K...</p>
  
  <p>I've been using this: curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);</p>
  
  <p>Thank You!</p>