[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 146
  • Last Modified:

find the extension of a file uploaded?

In coldfusion i need a statement which finds the image extension


example...
<cfset uploadedImage = cffile.serverfile>   \\ logo.jpg
search the var uploadedImage give me the  .jpg bit at the end i.e <cfset myext = find (\.) list last

not sure how to do this, anyone?



0
pigmentarts
Asked:
pigmentarts
  • 2
1 Solution
 
gdemariaCommented:

There is a built in variable called "clientFileExt"

you can reference it with  cffile.clientFileExt

 If you're using a pre-MX7 version of coldfusion you can use..

    listLast(clientFile,".")


0
 
gdemariaCommented:
I meant to include the cffile scope..

  listLast(cffile.clientFile,".")
0
 
pigmentartsAuthor Commented:
cool did not know that, perfect CF7 one works a treat. thank you :)
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now