title: Need FineUploader Method uploadStoredFiles to Complete Before Proceeding
body: <p>For some quick background, uploadStoredFiles() is a method used in the FineUploader plugin to asynchronously send attached file data to a server path. I'm also using AngularJS for my application. My question is actually very similar to the one found here...</p>
  
  <p><a href="https://stackoverflow.com/questions/1455870/jquery-wait-for-function-to-complete-to-continue-processing">jQuery: wait for function to complete to continue processing?</a></p>
  
  <p>... the big difference is that I don't have access to the callback function itself. Also, my script is running FineUploader as part of a larger form where attachments are optional, so using a FineUploader 'completed' callback won't help much either.</p>
  
  <p>Here's a code sample. Basically, if there are no attachments then the page should reload. If there are attachments, they should be uploaded, and THEN the page should reload.</p>
  
  <pre><code>if(hasAttachments)
  {
      myuploader.uploadStoredFiles();
  }
  
  //AngularJS call to refresh page
  $route.reload();
  </code></pre>
  
  <p>Most of the time, the page refreshes itself and the file is missing from its list until I do an additional refresh later on. I could hard code a wait time, but something about that seems inefficient and evil.</p>
  
  <p>Any suggestions or solutions would be welcome. I would especially love an Angular-ish solution, but I'll take what I can get.</p>