cancel
Showing results for 
Search instead for 
Did you mean: 

How to restrict drag and drop .exe file

Santosh_Yadav
Champ on-the-rise
Champ on-the-rise

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.

2 REPLIES 2

Santosh_Yadav
Champ on-the-rise
Champ on-the-rise

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,

Getting started

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.