Reputation: 33585
Using CF 9 Script how do I upload a file and rename at the same time?
Below is an examples of what I have so far it works but I cannot get the file extension for the image upload dynamically.
local.results=fileUpload("D:\wwwroot\imageStore\#local.hash#.#cffile.serverFileExt#","image","","makeUnique");
cffile.serverFileExt = error
Upvotes: 0
Views: 403
Reputation: 4748
You can use fileMove to rename in script after the file has uploaded.
Upvotes: 2
Reputation: 565
The serverFileExt value isn't available until after the upload completes. You would need to upload the file and then get the server file extension from the results structure.
Upvotes: 2