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
Post a Comment