From 67d2b6447071116764941c9f46e075d6aa296fab Mon Sep 17 00:00:00 2001 From: bourgeoa Date: Tue, 12 Nov 2019 23:20:09 +0100 Subject: [PATCH] delete check contentType match file extension --- src/widgets/dragAndDrop.js | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/src/widgets/dragAndDrop.js b/src/widgets/dragAndDrop.js index 137ae0756..040eca595 100644 --- a/src/widgets/dragAndDrop.js +++ b/src/widgets/dragAndDrop.js @@ -155,18 +155,18 @@ function makeDraggable (tr, obj) { ) } -/* uploadFiles - ** - ** Generic uploader of local files to the web - ** typically called from dropped file handler - ** Params - ** fetcher instance of class Fetcher as in kb.fetcher - ** files Array of file objects - ** fileBase URI of folder in which to put files (except images) (no trailing slash) - ** imageBase URI of folder in which to put images - ** successHandler(file, uploadedURI) Called after each success upload - ** With file object an final URI as params - */ +/** uploadFiles +** +** Generic uploader of local files to the web +** typically called from dropped file handler +** +** @param {Fetcher} fetcher instance of class Fetcher as in kb.fetcher +** @param {Array} files Array of file objects +** @param {String} fileBase URI of folder in which to put files (except images) (no trailing slash) +** @param {String } imageBase URI of folder in which to put images +** @param successHandler function(file, uploadedURI) Called after EACH success upload +** With file object an final URI as params +*/ function uploadFiles (fetcher, files, fileBase, imageBase, successHandler) { for (var i = 0; files[i]; i++) { const f = files[i] @@ -200,12 +200,6 @@ function uploadFiles (fetcher, files, fileBase, imageBase, successHandler) { alert(msg) throw new Error(msg) } - } else { - var extension = mime.extension(theFile.type) - if (theFile.type !== mime.lookup(theFile.name)) { - suffix = '_.' + extension - console.log('MIME TYPE MISMATCH -- adding extension: ' + suffix) - } } var folderName = theFile.type.startsWith('image/') ? imageBase || fileBase