This is my first post so I apologize in advance if it’s missing any info.
I’m converting a Coldfusion project to Lucee, and ran into an issue when uploading files. With Lucee, the destination value needs a filename, otherwise it creates a subdirectory and places the file in it.
Is there a way to make Lucee work like Coldfusion does with file uploads? (just give it a destination folder) Otherwise, I have a lot of code to update. Thank you for any feedback.
Could you share the problematic code snippet you are using to process a file upload? the forum supports markdown, do you can wrap code in three backticks to format it
One question, does the target directory exist?
It really doesn’t matter for this question, but please always mention which version of Lucee you are using
The target directory does exist, and the code always check if it does, just in case. With Coldfusion, the new image would be saved to the mentioned destination, but in Lucee it creates a new directory and saves the image in it. From what I see in the docs, I have to specify the file name in order for Lucee to save the image in the given destination folder.
Since I don’t know which type of file the users will upload, I first create a temp file with their upload, then rename it to “cffile.clientFile”.
I know it’s not a lot of changes, but we have a very large codebase and I would need to update the code in a lot of different places. I’m curious of there’s a way to make Lucee handle uploads the same way Coldfusion does. Thanks for any input!