how to judge if a file is exist

hello i want to use script to upload a outside picture to show on a button,but i am afraid if the link isn’t exist but seams not work, i can got the pic to the button when it exist ,but i can’t change the button’s picture to a default pic when it wan’t exist help

var download = new WWW (“…/Assets/” + “mypic.jpg”);
yield download;

var productPic:Texture = download.texture;

if (productPic==null){

//if the file not exist ,i am not sure what to use ,anyway this isn’t work

getFile( “/Product/Default/”+ DefaultTexture.jpg);
productPic = download.texture;

print(“find error”); }

help help
more problem heppend to the text and bytes, help please
Jonny thanks

The WWW.error value will usually tell you if the file was not found (it’s the usual HTTP 404 error). However, you should be careful that your server handles this correctly - some servers are set up to return an error page without a 404 error.

recenty the picture is still in my couputer ,so for i can’t get the right result lol. so WWW.error ==null means no problem . when i use www.error !=null. seams it didn’t work too ,srange