We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

allowDragAndDrop doesn't prevent files from being dropped (and uploaded)

I've set allowDragAndDrop to false and it prevents the user from dragging a file from one folder to another, but it doesn't prevent the user from dragging a file onto the details view and dropping it to upload it.  How can I prevent that use case?

3 Replies

KR Keerthana Rajendran Syncfusion Team December 4, 2019 10:13 AM UTC

Hi Brian, 
 
Good day to you. 
 
We have checked your reported query on prevent dragging a file during upload. By default, allowDragAndDrop of file manager component is set as false. There is no need to declare it in your application level. You can prevent the upload dragging by setting the dropArea of uploadObj in the FileManager as null using created () event. 
 
Refer to the below code snippet. 
<ejs-filemanager id='overview' #file [ajaxSettings]='ajaxSettings' [view]='view' (created)="created($event)"> 
    </ejs-filemanager> 
 
 created() { 
 this.file.element.querySelector(".e-control.e-uploader").ej2_instances[0].dropArea = null;  
    } 
 
 
 
For your reference, we have prepared a sample. 
 
 
Note: Upload functionality is prevented in online service, you can use the file manager local service in this link 
 
Please let us know, if you have any concerns. 
 
Regards, 
Keerthana. 



BC Brian Crawford December 4, 2019 03:41 PM UTC

Hi Keerthana, I want to just say thank you for providing excellent support. You have been very responsive and have provided examples of how to solve the issues I've run into. We are looking forward to your December release to fix some of the bugs.  Thanks!


KR Keerthana Rajendran Syncfusion Team December 5, 2019 09:06 AM UTC

Hi Brian, 

Most welcome and thank you for the valuable feedback on our support. We are glad to hear that the provided solutions helped you to achieve your requirement. You can track the status of bug fixes from their corresponding feedback links. Please get back to us if you need any further assistance on this.  
 
Regards, 
Keerthana.  


Loader.
Live Chat Icon For mobile
Up arrow icon