ajax - In JavaScript, is there a way to retrieve the content-type of a URL without retrieving the entire file? -


i determine if given url image without relying on file's extension. in javascript, there way url's http response headers without retrieving entire contents of file?

you can http head. covered in accessing web page's http headers in javascript

the head method identical except server must not return message-body in response. metainformation contained in http headers in response head request should identical information sent in response request. method can used obtaining metainformation entity implied request without transferring entity-body itself. method used testing hypertext links validity, accessibility, , recent modification.

http://www.w3.org/protocols/rfc2616/rfc2616-sec9.html


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -