title: How to create a valid file from an object that comes from an api?
body: <p>I have the following object:</p>
  <pre><code>const apiObj = {
    &quot;createdAt&quot;: 1608202763608,
    &quot;id&quot;: &quot;1VdY5QV8ICBpJg1WfpILtRRZCtEF3Q0If&quot;,
    &quot;mimeType&quot;: &quot;image/jpeg&quot;,
    &quot;name&quot;: &quot;Screenshot_1.jpg&quot;,
    &quot;size&quot;: &quot;121560&quot;
  }
  </code></pre>
  <p>And I want to create a file from this data. The first time I come across this and it seems that some other data is missing, for example, Blob. If so, please tell me what parameters are required to create a file.</p>
  <p>I tried to convert apiObj to file using the following script:</p>
  <pre><code>var convertObjToFile = new File([apiObj], apiObj.name, { type: apiObj.mimeType })
  const dataTransfer = new DataTransfer()
  dataTransfer.items.add(convertObjToFile)
  </code></pre>
  <p>The file is created but it is broken</p>