I want IE to drag and drop files into the form.

Asked 1 years ago, Updated 1 years ago, 107 views

Chrome and Safari allow you to drag and drop files into the form.(See picture below)

Enter a description of the image here

However, IE won't do this (drop will open the image in your browser).

Can I use JavaScript to drag and drop files into the form in IE?

I found a lot of plugins and sample codes to upload files in Ajax, but I couldn't find any information that says, "Just set them in the form, the submit will be submitted by clicking the button normally."

This information was close to purpose, but it didn't work with IE.

Please let me know if there is any information that might be helpful.
Thank you for your cooperation.

By the way, IE is OK for newer versions like IE11.

javascript html internet-explorer

2022-09-29 21:32

2 Answers

I've tried to do something similar before, so I'm posting this for your reference, although it's not a direct answer.

In conclusion, I couldn't drop it directly on the form either.So as a workaround, we've done things like prepare a separate drop area (created a space with a div tag), addEventListener adds drop events, and retrieves and displays the dropped file names in the drop event.

However, in my case, I had to select multiple files, so I didn't use the file name entry field, but I displayed it as a table element, so I don't know if I can display the retrieved file name in a script (I remember I couldn't, I'm not sure).

For this reason, we have also crafted submit button events to post multiple files that we are viewing.

I'm afraid there's a roundabout way, but there's a workaround like this.


2022-09-29 21:32

As I checked with IE10(Win732bit), it is possible with ng-file-upload.

src=


2022-09-29 21:32

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.