0

I am developing a web-based tool that allows users to upload photos to my website from their mobile device. In order to manage uploads in areas with poor connectivity, and avoid having the users burn their own data, I want to create an upload queue that stores the file name for each requested photo, and then (manually) initiate the upload of the entire queue later, once the user has access to a WiFi connection.

Can fine-uploader be configured to do this?

1 Answers1

0

Yes, this is a very simple task. Simply set the autoUpload configuration option to false, and then add a click handler to an upload button that, when pressed, calls the uploadStoredFiles API method. This will result in Fine Uploader sending the user-selected files to your server.

In your document, include your template and the following elements:

<div id="upload-container"></div>
<button id="upload-button">Upload files</button>

A simple configuration for your Fine Uploader instance, along with the click handler, will look like this:

var manualUploader = new qq.FineUploader({
   element: document.getElementById('upload-container'),
   request: {
      endpoint: '/server/uploads'
   },
   autoUpload: false,
});

qq(document.getElementById("upload-button")).attach("click", function() {
   manualUploader.uploadStoredFiles();
});

A much more complete example can be found at http://fineuploader.com/demos#manually-trigger-uploads. See the code just below the live demo.

Ray Nicholus
  • 19,538
  • 14
  • 59
  • 82