I have only a normal form with some input fields and one file input field. I am using the Blueplay Jquery download plugin to upload a file. It seems to work if you select a file and after that click the "Download" button. But if you re-select the files to download, this saves the entire history of the selection, and after sending it sends all the XHR to the server.
I want to download only one currently selected file, not all previously selected files (in the file open dialog box).
Here is my js module for handling loading:
$(function () { $('#upload_form').fileupload({ dataType: 'json', autoUpload: false, fileInput: '#filechose_button', replaceFileInput: false, maxNumberOfFiles: 1, multipart: true, add: function (e, data) { $('#upload_button').click(function () { $('#upload_button').attr('disabled', true); ... data.submit(); ... }); }, done: function (e, data) { ...
The solutions I found here ( How to upload a file only once with the plugin to download the blueimp file? ) Seems to be not the best way (I see it as dirty), because simply disabling the click event still does not solve the problem of collecting all earlier selected files (type of memory leaks)
The maxNumberOfFiles: 1 option does not work for me.
source share