Skip to content
Permalink
Browse files

Fixed file type issues when dropping files

  • Loading branch information
RonnieSan committed Jul 17, 2018
1 parent bcc3852 commit 07e3c9d975842e93bb968b2593bcabe5d54eadaa
BIN -8 KB .DS_Store
Binary file not shown.
@@ -0,0 +1 @@
.DS_Store
@@ -1,5 +1,5 @@
/*
UploadiFive 1.2.2
UploadiFive 1.2.3
Copyright (c) 2012 Reactive Apps, Ronnie Garcia
Released under the UploadiFive Standard License <http://www.uploadify.com/uploadifive-standard-license>
*/

Large diffs are not rendered by default.

BIN -7.63 KB Sample/uploadifive.zip
Binary file not shown.
@@ -1,4 +1,7 @@
UploadiFive Change Log

v1.2.3
* Fixed file type option when dropping files

v1.1.2
* Fixed typo on line 424 'uplaodAll' => 'uploadAll'
19 jquery.uploadifive.js 100755 → 100644
@@ -1,5 +1,5 @@
/*
UploadiFive 1.2.2
UploadiFive 1.2.3
Copyright (c) 2012 Reactive Apps, Ronnie Garcia
Released under the UploadiFive Standard License <http://www.uploadify.com/uploadifive-standard-license>
*/
@@ -81,6 +81,12 @@ Released under the UploadiFive Standard License <http://www.uploadify.com/upload
*/
}, options);

// Create an array of file types
var file_types;
if (settings.fileType) {
file_types = settings.fileType.split('|');
}

// Calculate the file size limit
if (isNaN(settings.fileSizeLimit)) {
var fileSizeLimitBytes = parseInt(settings.fileSizeLimit) * 1.024;
@@ -172,6 +178,10 @@ Released under the UploadiFive Standard License <http://www.uploadify.com/upload

// Drop a file into the queue
$data.drop = function(e) {
// Stop FireFox from opening the dropped file(s)
e.preventDefault();
e.stopPropagation();

$data.queue.selected = 0;
$data.queue.replaced = 0;
$data.queue.errors = 0;
@@ -197,6 +207,9 @@ Released under the UploadiFive Standard License <http://www.uploadify.com/upload
for (var n = 0; n < limit; n++) {
file = fileData.files[n];
$data.addQueueItem(file);
if (file_types && file_types.indexOf(file.type) === -1) {
$data.error('FORBIDDEN_FILE_TYPE', file);
}
}
// Save the data to the inputs object
$data.inputs[inputName] = fileData;
@@ -211,10 +224,6 @@ Released under the UploadiFive Standard License <http://www.uploadify.com/upload
if (typeof settings.onDrop === 'function') {
settings.onDrop.call($this, fileData.files, fileData.files.length);
}

// Stop FireFox from opening the dropped file(s)
e.preventDefault();
e.stopPropagation();
};

// Check if a filename exists in the queue

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.

0 comments on commit 07e3c9d

Please sign in to comment.
You can’t perform that action at this time.