Answered
<cfif> problems
Hi,
I'm trying to build a coldfusion script that will allow users to upload files. This part works fine, but I'm also trying to get the script to generate the relevant linking tags for the uploaded file, depending on whether it's an image or not.
To do this, I'm currently using a <cfif> statement to check the file extension, like this:
<cfif #CFFILE.ServerFileExt# IS "jpg" OR "bmp" OR "gif" OR "png" OR "jpeg">
When I try to upload an image, it works fine and produces the relevant tags. But when I upload a file that isn't an image, it gives me this error:
cannot convert the value "bmp" to a boolean
I've also tried using the <CFIF IsArray(myarray) IS "condition1" OR "condition2"> statement, which also gave me errors.
Would be grateful if anyone could help.
Thanks.
I'm trying to build a coldfusion script that will allow users to upload files. This part works fine, but I'm also trying to get the script to generate the relevant linking tags for the uploaded file, depending on whether it's an image or not.
To do this, I'm currently using a <cfif> statement to check the file extension, like this:
<cfif #CFFILE.ServerFileExt# IS "jpg" OR "bmp" OR "gif" OR "png" OR "jpeg">
When I try to upload an image, it works fine and produces the relevant tags. But when I upload a file that isn't an image, it gives me this error:
cannot convert the value "bmp" to a boolean
I've also tried using the <CFIF IsArray(myarray) IS "condition1" OR "condition2"> statement, which also gave me errors.
Would be grateful if anyone could help.
Thanks.
