Question:
Essence of the question:
There is a form for filing an advertisement. It is necessary to upload photos via drag and drop. But you need to do this when sending all form fields, i.e. at a time. Photos must be loaded without ajax, because there are no ads on the server at the time of uploading the images yet. Is it possible to implement such functionality? The browser prohibits javascript from modifying the sent files.
Answer:
Solution to your problem:
Article
https://css-tricks.com/drag-and-drop-file-uploading/
Demo
https://css-tricks.com/examples/DragAndDropFileUploading/
Submit On Demand mode is suitable for you.
All the necessary and step-by-step instructions are present in the article, you can additionally transfer custom data and send the form with a regular post multipart/form-data
request.