My action code looks like this, and it works.
cffile action="upload" destination="#ExpandPath('/images/homes' & '#SESSION.mm_listing_id#' & '_image1' & '.jpg')#" filefield="FORM.upload_file" nameconflict="overwrite" accept="image/*"/>
The problem comes when I try to resize the image. While the file uploads and renames the way I want, since I have defined the extension as .jpg, Coldfusion throws an error when the original image is not a jpg.
Here is the cfimage code that fails when I apply it to an image with an improper extension.
<cfimage action="resize" width="300" height="" source="#ExpandPath('/images/homes/#file.ServerFile#')#" destination="#ExpandPath('/images/homes')#" overwrite="yes">
The question is, can I name the uploading file in the destination attribute and maintain the files original extension so that I can later edit the file with CfImage?