As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
Hi, I don't want to allow .exe file to drag and drop by user while edit document. Can any one tell me how to do this.
Hi, I have fixed this bug by changing code in jquery.dnd-file-upload.js of nuxeo-platform-webapp-base bundle. In this file I have change function processFileOrFolderEntryAsync() as fillows:
function processFileOrFolderEntryAsync(fileOb, opts, fileCB, folderCB, transferItem) { // filter Folders from dropped content // Folder size is 0 under Win / %4096 under Linux / variable under MacOS if(fileOb.type =="application/x-ms-dos-executable"){// code added for not to allow .exe files to drag and drop alert(".exe file not allowed"); cancelUploadIfNoValidFileWasDropped(opts) // code added for not to allow .exe files to drag and drop }else if (!fileOb.type && fileOb.size < (4096 * 4 + 1)) { try { // need to test the file by reading it ... var reader = new FileReader(); reader.onerror = function (e) { folderCB(fileOb, opts, transferItem); }; reader.onabort = function (e) { folderCB(fileOb, opts, transferItem); }; reader.onload = function (e) { fileCB(fileOb, opts); }; reader.readAsText(fileOb); } catch (err) { folderCB(fileOb, opts, transferItem); } } else { fileCB(fileOb, opts); } }
hi santhosh,