diff --git a/cloud/templates/cloud/cloud_main.html b/cloud/templates/cloud/cloud_main.html index 3c5256d..9312e7a 100644 --- a/cloud/templates/cloud/cloud_main.html +++ b/cloud/templates/cloud/cloud_main.html @@ -730,9 +730,7 @@ $('.droppable_div').on('dragleave', function (e) { currentid = e["currentTarget"]['id']; $("#{{parentid}}_div").removeClass('bg-secondary'); }); - -allowedtypes = "application/msword, application/vnd.ms-excel, application/vnd.ms-powerpoint, text/plain, application/pdf, image/*, image/x-png, image/gif, image/jpg, image/jpeg, image/JPEG, image/JPG, docx, JPEG, JPG, doc, odt, ODT, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.openxmlformats-officedocument.presentationml.presentation" - +allowedtypes = "application/msword, application/vnd.ms-excel, application/vnd.ms-powerpoint, text/plain, application/pdf, image/*, image/x-png, image/gif, image/jpg, image/jpeg, image/JPEG, image/JPG, docx, JPEG, JPG, doc, odt, ODT, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.openxmlformats-officedocument.presentationml.presentation, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" function uploadAction(filetodo, parid){ var formData = new FormData($("#uploadFileForm")[0]); diff --git a/cloud/views.py b/cloud/views.py index 5db8fbf..d470658 100644 --- a/cloud/views.py +++ b/cloud/views.py @@ -235,7 +235,7 @@ def adddirbyajax(request, parent): uploadsource = request.POST["uploadsource"] # VALIDATE FILE-TYPE file_ext = request.FILES['uploadedfile'].name.split(".")[1] - allowed_types = ["txt", "TXT", "png", "PNG", "jpeg", "JPEG", "jpg", "JPG", "PDF", "pdf", "csv", "CSV", "DOC", "doc", "DOCX", "docx", "ODT", "odt", "PPT", "ppt", "PPTX", "pptx"] + allowed_types = ["txt", "TXT", "png", "PNG", "jpeg", "JPEG", "jpg", "JPG", "PDF", "pdf", "csv", "CSV", "DOC", "doc", "DOCX", "docx", "ODT", "odt", "PPT", "ppt", "PPTX", "pptx", "XLS", "xls", "XLSX", "xlsx"] file_ok = False for t in allowed_types: if t == file_ext: diff --git a/standards/templates/standards/standards_add.html b/standards/templates/standards/standards_add.html index 76c488c..4d51d48 100644 --- a/standards/templates/standards/standards_add.html +++ b/standards/templates/standards/standards_add.html @@ -485,7 +485,7 @@ $('#directdiv').on('dragleave', function (e) { $("#directdiv").removeClass('bg-secondary'); }); -allowedtypes = "application/msword, application/vnd.ms-excel, application/vnd.ms-powerpoint, text/plain, application/pdf, image/*, image/x-png, image/gif, image/jpg, image/jpeg, image/JPEG, image/JPG, docx, JPEG, JPG, doc, odt, ODT, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.openxmlformats-officedocument.presentationml.presentation" +allowedtypes = "application/msword, application/vnd.ms-excel, application/vnd.ms-powerpoint, text/plain, application/pdf, image/*, image/x-png, image/gif, image/jpg, image/jpeg, image/JPEG, image/JPG, docx, JPEG, JPG, doc, odt, ODT, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.openxmlformats-officedocument.presentationml.presentation, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" function uploadButtonPush(){ @@ -504,6 +504,7 @@ function uploadAction(filetodo){ var formData = new FormData(); formData.append("uploadedfile", filetodo); formData.append("uploadsource", "standards"); + console.log(filetodo.type); if(allowedtypes.indexOf(filetodo.type) != -1 && filetodo.type.length > 0){ $.ajax({ url: "{% url 'cloud-adddir' parentid %}", diff --git a/standards/templates/standards/standards_update.html b/standards/templates/standards/standards_update.html index 9ccd68a..b5dcbc6 100644 --- a/standards/templates/standards/standards_update.html +++ b/standards/templates/standards/standards_update.html @@ -566,9 +566,7 @@ $('#directdiv').on('dragleave', function (e) { $("#directdiv").removeClass('bg-secondary'); }); -allowedtypes = "application/msword, application/vnd.ms-excel, application/vnd.ms-powerpoint, text/plain, application/pdf, image/*, image/x-png, image/gif, image/jpg, image/jpeg, image/JPEG, image/JPG, docx, JPEG, JPG, doc, odt, ODT, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.openxmlformats-officedocument.presentationml.presentation" - - +allowedtypes = "application/msword, application/vnd.ms-excel, application/vnd.ms-powerpoint, text/plain, application/pdf, image/*, image/x-png, image/gif, image/jpg, image/jpeg, image/JPEG, image/JPG, docx, JPEG, JPG, doc, odt, ODT, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.openxmlformats-officedocument.presentationml.presentation, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" function uploadButtonPush(){ $("#uploadedfile").click();