title: Append object which contain File and String value into FormData - JS
body: <p>I'm finding a solution to append object which contain File and String value into FormData and send it to server (MultiPartParser of Django Rest FrameWork).</p>
  
  <p>Console.log(file)
  <a href="https://i.stack.imgur.com/zmJGo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zmJGo.png" alt="enter image description here"></a></p>
  
  <p>Now my code is:</p>
  
  <pre><code>Fd.append('file_uploads', JSON.stringify({ 'file': file, 'order_num': 1 }) )
  </code></pre>
  
  <p>When I console.log this value of form data, it returns <code>{"file":{},"order_num":1}</code>. You can see <strong>file value is empty</strong>.</p>
  
  <p>I tried to remove <code>JSON.stringify</code>:</p>
  
  <pre><code>Fd.append('file_uploads', { 'file': file, 'order_num': 1 } )
  </code></pre>
  
  <p>When I console.log this value of form data, it returns <code>[object, object]</code>.</p>
  
  <p>I want the results is </p>
  
  <p><code>{"file":&lt;file_object&gt;,"order_num":1}</code></p>