I'm using a cffile
tag to upload my file and resave it with a new name. My issue is that the file could be a few different formats and I don't know how to detect the file extension. I'm using the code below:
<cfset ui = createUUID()>
<cffile
action="upload"
accept="video/x-flv, video/mp4, video/x-msvideo"
destination="e:\www2\uploads\#ui#.#cffile.ServerFileExt#"
nameconflict="makeunique"
filefield="form.file"
>
It's telling me that cffile is undefined.
I recommend uploading first, then renaming:
<cfset ui = createUUID()>
<cffile
action="upload"
accept="video/x-flv, video/mp4, video/x-msvideo"
destination="e:\www2\uploads\"
nameconflict="makeunique"
filefield="form.file"
/>
<cffile
action="rename"
source="e:\www2\uploads\#cffile.serverFileName#"
destination="e:\www2\uploads\#ui#.#cffile.serverFileExt#"
/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With