I\'d like to change drop zone background color to green or red depending on whether the contained drag over payload contains supported file types (JPEG).
Do Ge
I don't think you can rely on the browser to give you the MIME type. It'd be much simpler if you checked the filename extension. :)
If you really want to check the file type, read the payload using DataTransfer.getData() and check the leading bytes (PNG, GIF89, JFIF or something).
DataTransfer.getData()
PNG
GIF89
JFIF