Cffile upload problem in ubunto



I’m on ubuntu 18.04 and attempted to upload an image file via cffile upload from a FORM submission.


<cffile action="upload"

Error msg:
attribute destination has an invalid value
[/home2/userX/lucee/www/myhandsome.jpg], directory [/home2/userX/lucee/www] doesn’t exist
Stacktrace The Error Occurred in
/var/www/myfileupldoad.cfm: line 72

but directory, /home2/userX/lucee/www DOES exist and it’s the FULL path.

And the lucee is a docker image, lucee52.




It exists… in the docker image?


This is more than likely a permissions issue.

Check and make sure that Lucee can CRUD files in that directory.


More specifically you can run <cfdump var="#getFileInfo("/home2/userX/lucee/www")#"> and it will have info such as canRead, canWrite make sure those are both true first. If they are false then you need to give the user that lucee is running as write permission to that directory.

Pete Freitag


Thank you all for your informative responses, I’ll try Pete’s advice first.


Debugging is a good suggestion.


sorry for late response, definitely.


Ok, I’m getting back to cf file manipulation tags under Lucee container image ( lucee52 ) for linux/ubunto.
Before I continue, let me take a sec to thank all those who have been graciously helpful for 2018.
currently, for cffile action=“write”, the file is written to the default /var/www folder,
<cffile action="write" file="#ExpandPath('./myfile.doc')#" output="#mybinarydatastring#">
that is, the above code creates /var/www/myfile.doc
which is not web / user accessible. attempted to use cffile action=“copy” to copy it to my {web-root-folder} failed.
<cffile action="copy" source=#ExpandPath('./myfile.doc')# destination="/home/userX/lucee/www">
err msg to the effect, “can’t copy … no file or directory” but I believe the cffile write action was successful.

Attempt to cffile write to /home/userX/lucee/www folder directory (hard code) resulted in “parent directory does not exist” error.

What else can we try?
Yep, cfheader/cfcontent is an alternative, it seems to work.