title: How to convert an InMemoryUploadedFile in django to a fomat for flickr API?
body: <p>I have a class that uploads a file to Flickr. The file is of type<br>
  'InMemoryUploadedFile'.</p>
  
  <p>I would like to know how to convert or pass the data in the 'InMemoryUploadedFile' file, to a format for flickr's API?</p>
  
  <p>Eg:</p>
  
  <pre><code>{'photo': ('image.jpg', &lt;InMemoryUploadedFile: image.jpg (image/jpeg)&gt;)}
  </code></pre>
  
  <p>Upload API: <a href="https://www.flickr.com/services/api/upload.api.html" rel="noreferrer">https://www.flickr.com/services/api/upload.api.html</a></p>
  
  <p><strong>Error Code</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;rsp stat="fail"&gt;
      &lt;err code="4" msg="Filesize was zero" /&gt;
  &lt;/rsp&gt;
  </code></pre>