title: Specify filename when using httr to POST file in R
body: <p>Trying to upload a datafile from R using <code>httr</code> <code>POST</code>.  The following almost works but I need to specify the filename, e.g. <code>"mydata.csv"</code>.  How do I specify the filename?  It's blank when it reaches the server.</p>
  
  <pre><code>POST(uri, body=list(y=upload_file(filename)))
  </code></pre>
  
  <p>In <code>curl</code> one would specify it with a <code>-F name=filename</code> as in :</p>
  
  <pre><code>curl -i -F name=test -F filedata=@localfile.jpg http://example.org/upload
  </code></pre>
  
  <p><a href="https://stackoverflow.com/questions/31080363/how-to-post-multipart-related-content-with-httr-for-google-drive-api">How to POST multipart/related content with httr (for Google Drive API)</a></p>