Link to home
Start Free TrialLog in
Avatar of pigmentarts
pigmentartsFlag for United Kingdom of Great Britain and Northern Ireland

asked on

check file ext

hi i need to check my file ext before i upload, at the moment it does not work??


            <!---check its a image--->            
            <cfset allowfiles = "jpg,jpeg,gif,png">      
            <cfif listfindnocase(allowfiles,'form.image')>
            <cfset error = "Error: An articsdvfdst">
            </cfif>
ASKER CERTIFIED SOLUTION
Avatar of dgrafx
dgrafx
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of trailblazzyr55
trailblazzyr55

please ignore the duplicate image/jpg in the accept attib... this is more correct

<cffile
  action = "upload"
  fileField = "form.field"
  destination = "you_absolute_path"
  nameConflict = "MakeUnique"
  accept = "image/jpg, image/jpeg, image/gif, image/png">
Avatar of pigmentarts

ASKER

thanks,

used both


doe the cf check first then just in case done,

 accept = "image/jpg, image/jpeg, image/gif, image/png">