title: I cannot upload my file via POST with cURL
body: <p>I'm trying to upload firmware to a computer via API, which normally I do through the click of a button on our web server. This is the 'General' header:</p>
  
  <pre><code>Request URL:http://192.168.243.179:8080/firmware/linux/
  Request Method:POST
  Status Code:200 OK
  Remote Address:192.168.243.179:8080
  Referrer Policy:no-referrer-when-downgrade
  </code></pre>
  
  <p>On the firmware page, I would click a button and it uploads my firmware file to /firmware/linux/.</p>
  
  <p>This is my response header when I submit the firmware file:</p>
  
  <pre><code>HTTP/1.1 200 OK
  Date: Tue, 11 Apr 2017 23:22:43 GMT
  Content-Length: 134
  Content-Type: text/html;charset=utf-8
  Server: CherryPy/3.2.2
  </code></pre>
  
  <p>Here is my request header:</p>
  
  <pre><code>POST /firmware/linux HTTP/1.1
  Host: 192.168.243.179:8080
  Connection: keep-alive
  Content-Length: 63067756
  Cache-Control: max-age=0
  Origin: http://192.168.243.179:8080
  Upgrade-Insecure-Requests: 1
  User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36
  Content-Type: multipart/form-data; boundary=----
  WebKitFormBoundarynaUDhUWIArqOTvuC
  Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
  Referer: http://192.168.243.179:8080/firmware/
  Accept-Encoding: gzip, deflate
  Accept-Language: en-GB,en-US;q=0.8,en;q=0.6
  </code></pre>
  
  <p>and my request payload:</p>
  
  <pre><code>------WebKitFormBoundarynaUDhUWIArqOTvuC
  Content-Disposition: form-data; name="image"; filename="uImage-jjr-dvr-
  atlas_v1.0.1-16-g5e31aec"
  Content-Type: application/octet-stream
  
  ------WebKitFormBoundarynaUDhUWIArqOTvuC--
  </code></pre>
  
  <p>I am using the following cURL command to imitate these requests to POST my firmware file over to the computer:</p>
  
  <pre><code>curl -i -X POST -d @"C:\Users\name\Documents\firmware/firmwarefile" http://192.168.243.179:8080/firmware/linux/ -H "Content-Type: multipart/form-data"
  </code></pre>
  
  <p>The above yields the error <code>ValueError: Invalid boundary in multipart form: ''</code></p>
  
  <p>I then try it with a boundary as supplied in my request header:</p>
  
  <pre><code>curl -i -X POST -d @"C:\Users\name\Documents\firmware/firmwarefile" http://192.168.243.179:8080/firmware/linux/ -H 
  "Content-Type: multipart/form-data; boundary=----WebKitFormBoundarynaUDhUWIArqOTvuC"
  </code></pre>
  
  <p>The above command yields no errors, but I then check if the firmware has been updated, and it hasn't.</p>
  
  <p>Am I posting my file correctly? I don't understand why the firmware file is not being pushed through.</p>
  
  <p>Thanks for the help in advance.</p>