Question
Check if image Exists, Bug in function.
I found a function that checks to see if an image exists. I
pasted it below, but there seems to be this weird bug. If a
subdomain is in the url of the image but the subdomain is wrong,
you'll get an exception saying: Element Content-Type is undefined
in a CFML structure referenced as part of an expression.
For example, if the correct url is:
http://images.whatever.com/photos/man.jpg
and you change the subdomain like so:
http://imag.whatever.com/photos/man.jpg
The weird thing is that it works even if you mess up the domain name, directories or image name, but not the subdomain.
original code here:
http://www.succor.co.uk/index.cfm/2007/3/18/How-to-check-if-an-image-exists-with-HTTP
For example, if the correct url is:
http://images.whatever.com/photos/man.jpg
and you change the subdomain like so:
http://imag.whatever.com/photos/man.jpg
The weird thing is that it works even if you mess up the domain name, directories or image name, but not the subdomain.
original code here:
http://www.succor.co.uk/index.cfm/2007/3/18/How-to-check-if-an-image-exists-with-HTTP
