java - How to determine if URL is an image? -


i check if url given user image (jpg, png, gif). first idea: check file extension in url. second idea: resource server (by http get) , load java picture library info if image (seriously disadvantage: slow). or maybe yet solution?

you should use http head, not full get. should include content-type known server. of course test extension first, , expensive/slow http roundtrip if it's inconclusive.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -