Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy doesn't Blueimp's jQuery-File-Upload plugin fire callbacks?
    primarykey
    data
    text
    <p>I'm experimenting with <a href="https://github.com/blueimp/jQuery-File-Upload" rel="noreferrer">Blueimp's jQuery-File-Upload</a> plugin, which judging by the <a href="http://aquantum-demo.appspot.com/file-upload" rel="noreferrer">demo</a> looks very promising.</p> <p>It's really easy to implement:</p> <pre><code>var $uploadButton = $("#fileop-upload");// &lt;input type="file" id="fileop-upload" [etc] /&gt; $uploadButton.fileupload({ url : "//domain/path/to/receive-uploaded-files" }); </code></pre> <p>The selected files are uploaded fine without refreshing the page as expected, but of course with a minimal configuration like this the user won't get any notification. Here's where the plugin's callbacks would come in handy.</p> <p>According to the documentation there are two ways to define callbacks. For example the <code>add</code> event (which fires whenever a file is selected for uploading) can be added in the original configuration object like this:</p> <pre><code>$uploadButton.fileupload({ add : addFileListener, url : "//domain/path/to/receive-uploaded-files" }); </code></pre> <p>or alternatively:</p> <pre><code>$uploadButton.bind("fileuploadadd", addFileListener); </code></pre> <p>However I've found that only the first approach works, the second one doesn't do anything.</p> <p>It is even more curious that no other callbacks -- especially <code>progress</code> and <code>start</code> -- seems to be firing not matter how I bind them:</p> <pre><code>$uploadButton.fileupload({ add : addFileListener, progress : progressListener, start : startListener, url : "//domain/path/to/receive-uploaded-files" }); </code></pre> <p>or</p> <pre><code>$uploadButton.fileupload({ add : addFileListener, url : "//domain/path/to/receive-uploaded-files" }); $uploadButton.bind("fileuploadprogress", progressListener"); $uploadButton.bind("fileuploadstart", startListener"); </code></pre> <p>I have the referred listener functions defined, and the code doesn't report any errors or warnings.</p> <p>What is the explanation for the <code>.bind</code> method's failure, and why doesn't the <code>progress</code> or the <code>start</code> listeners ever activate?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload