From afa4394052c3c76ac2e801f0a04dfed6d6063b46 Mon Sep 17 00:00:00 2001 From: Uncled1023 Date: Tue, 11 Jul 2017 21:17:51 -0700 Subject: [PATCH] Changed upload to bypass loading of blob if we aren't encrypting client side. --- Teknik/Areas/Upload/Scripts/Upload.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Teknik/Areas/Upload/Scripts/Upload.js b/Teknik/Areas/Upload/Scripts/Upload.js index 7f11952..bc210cf 100644 --- a/Teknik/Areas/Upload/Scripts/Upload.js +++ b/Teknik/Areas/Upload/Scripts/Upload.js @@ -181,8 +181,19 @@ function createUpload(fileName) { function processFile(fileBlob, fileName, contentType, contentSize, fileID) { // Check the file size if (contentSize <= maxUploadSize) { - // Encrypt the file and upload it - encryptFile(fileBlob, fileName, contentType, fileID, uploadFile); + + var fileExt = getFileExtension(fileName); + + // Get session settings + var encrypt = $('#encrypt').is(':checked'); + + if (encrypt) { + // Encrypt the file and upload it + encryptFile(fileBlob, fileName, contentType, fileID, uploadFile); + } else { + // pass it along + uploadFile(fileBlob, null, null, contentType, fileExt, fileID, encrypt); + } } else { // An error occured