DropZone acceptedFiles type filter

前端 未结 3 1698
野的像风
野的像风 2021-02-05 08:00

I\'ve got a DropZone form working perfectly with one exception, I can\'t seem to limit the file types as precisely as I need to.

Using acceptedFiles: \"image/*\"<

3条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-05 08:36

    More trial and error eventually turned up the solution:

    Dropzone.options.dzone = {
    acceptedFiles: "image/jpeg,image/png,image/gif"
    }
    

    Apparently my error was primarily in using jpg which made it all fail. The above works like a charm.

提交回复
热议问题