Hi all,
As part of trying to let users upload a jpg or gif file, I created a form with the following file field:
When the form is submitted, I want to check if the last 3 places in the "picture1" file field are "jpg" or "gif". Im trying to do that with the following code:
For some reason it is always going to the default case, even when the file ive chosen ends in "jpg" or "gif". Am I missing something here?
As part of trying to let users upload a jpg or gif file, I created a form with the following file field:
Code:
<input type="file" name="picture1" size="40">
When the form is submitted, I want to check if the last 3 places in the "picture1" file field are "jpg" or "gif". Im trying to do that with the following code:
Code:
<cfswitch expression="#right(form.picture1, 3)#">
<cfcase value="jpg">
cffile upload goes here
</cfcase>
<cfcase value="gif">
cffile upload goes here
</cfcase>
<cfdefaultcase>
code goes here that displays message "file is not a jpg or gif"
</cfdefaultcase>
</cfswitch>
For some reason it is always going to the default case, even when the file ive chosen ends in "jpg" or "gif". Am I missing something here?