Drag & Drop Upload
Drag & Drop Upload
Following this: https://editor.datatables.net/plug-ins/field-type/editor.upload
The user may drop more than one photo in the drag n drop field creating multiple records of the same file in the database and server.
1. How would I allow only one file.
This question has an accepted answers - jump to answer
This discussion has been closed.

Answers
Hi,
What you would need to do is immediately before the
dataTransfer.filearray is accessed (e.originalEvent.dataTransfer.files[0]), do a check on the length. If it is > 1, then show an error - otherwise just have the code carry on!Allan