title: GAE/J - Blobstore - how to determine if file is not uploaded
body: <p>I am working on web application and using GAE/J blobstore tutorial <a href="http://code.google.com/appengine/docs/java/blobstore/overview.html" rel="nofollow">http://code.google.com/appengine/docs/java/blobstore/overview.html</a> I was able to upload file to blobstore. </p>
  
  <p>My Problem is my "upload file" option is OPTIONAL on form. So user may or maynot choose to upload the file on my form. So since this field is optional, I do not have any upfront form validation for this field, but then when i submit the form "a blank document with 0kb file gets uploaded to blobstore" since i am not able to determine if user has selected any file or not inside servlet.</p>
  
  <p>I tried Apache file upload (ServletFileUpload..etc) but it keeps returning null everytime. </p>
  
  <p>so not sure, how do i determine if user have selected any file to upload inside servlet?</p>
  
  <pre><code>            Map&lt;String, BlobKey&gt; blobs = blobstoreService.getUploadedBlobs(req);
              if (blobs != null &amp;&amp; blobs.size() &gt; 0) {
                  BlobKey blobkey = blobs.get("myFile");
                  blobkeyStr = blobkey.getKeyString();
              }
  </code></pre>