Detect mime type of an image via Javascript

前端 未结 2 1557
粉色の甜心
粉色の甜心 2021-01-17 15:23

i am detecting images on my webpage with javascript document.images function which returns an rray of images. Is there any way to get the mime type of the image from this si

2条回答
  •  无人及你
    2021-01-17 15:52

    I don't think this is possible, apart from requesting the image again in jQuery and trying to use a MIME type check on the data. (You might be able to send a HEAD request and get whatever Content-type was returned)

提交回复
热议问题