From 52e1d24769da5558e18f7a1173fb2d7a039cfa22 Mon Sep 17 00:00:00 2001 From: bourgeoa Date: Wed, 23 Oct 2019 22:59:57 +0200 Subject: [PATCH] contentType mismatch solved by NSS --- src/widgets/dragAndDrop.js | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/src/widgets/dragAndDrop.js b/src/widgets/dragAndDrop.js index e979dae10..fb693abc7 100644 --- a/src/widgets/dragAndDrop.js +++ b/src/widgets/dragAndDrop.js @@ -129,16 +129,16 @@ function makeDraggable (tr, obj) { }, false) } -/* uploadFiles +/** 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 +** +** @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) { @@ -165,12 +165,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 : fileBase var destURI = folderName + (folderName.endsWith('/') ? '' : '/') + encodeURIComponent(theFile.name) + suffix