title: How to distinguish between mutli-part form data of empty file and missing file?
body: <p>I try on server side to distinguish between the upload of empty file and not-uploaded file</p>
  <p>The POST body content of an empty file is:</p>
  <pre><code>------WebKitFormBoundaryAYxCGhPMYcmdkdlv
  Content-Disposition: form-data; name=&quot;_1&quot;
  
  dd
  ------WebKitFormBoundaryAYxCGhPMYcmdkdlv
  Content-Disposition: form-data; name=&quot;_2&quot;; filename=&quot;foo&quot;
  Content-Type: application/octet-stream
  
  
  ------WebKitFormBoundaryAYxCGhPMYcmdkdlv
  Content-Disposition: form-data; name=&quot;_3&quot;
  
  Upload
  ------WebKitFormBoundaryAYxCGhPMYcmdkdlv--
  </code></pre>
  <p>While missing file is</p>
  <pre><code>------WebKitFormBoundaryMldAHhbBqWpKPlRY
  Content-Disposition: form-data; name=&quot;_1&quot;
  
  dd
  ------WebKitFormBoundaryMldAHhbBqWpKPlRY
  Content-Disposition: form-data; name=&quot;_2&quot;; filename=&quot;&quot;
  Content-Type: application/octet-stream
  
  
  ------WebKitFormBoundaryMldAHhbBqWpKPlRY
  Content-Disposition: form-data; name=&quot;_3&quot;
  
  Upload
  ------WebKitFormBoundaryMldAHhbBqWpKPlRY--
  </code></pre>
  <p>The only difference is <code>filename=</code> content one is empty other contains the file name (same behavior for Firefox and Chromium)</p>
  <p>Questions:</p>
  <ol>
  <li>Are there any conditions that browser wouldn't provide a <code>filename</code> (security or something like that)?</li>
  <li>Is it actually valid/standard way to distinguish between empty file and non-set file, please provide reference.</li>
  <li>Is <code>Content-Type: application/octet-stream</code> is standard response and it will be set in case of non-uploaded file?</li>
  </ol>
  <p>I'd like to see some references to standards that confirm or disprove my observations</p>