DharameshShrivastava wrote:
destination ="#getdirectoryFromPath(expandPath("CFFileUpload.cfm"))#/Upload/#FORM.FILENAME#"
|
The destination should be a directory, not a file. So, use getdirectoryFromPath(expandPath('CFFileUpload.cfm'))#/Upload/. Check beforehand that the directory exists.
<cfset returnValue=
{
STATUS=200
, MESSAGE = "Successfully Uploaded"
, FILENAME = CFFILE.SERVERFILE
}>
|
I doubt whether the structure cffile exists when you are using <cffile action="uploadAll">. That is because you are then uploading multiple files. You should use instead the result attribute, which stores the properties of the uploaded files in an array whose elements correspond to the respective files.
In any case, why would you want to output anything in the page UploadHandler.cfm anyway? You never get to see it! The page you currently see is CFFileUpload.cfm. In my opinion, you could just simplify the page content to
UploadHandler.cfm
<cfsilent>
<cffile action="uploadall" filefield="FILEDATA" nameconflict="makeunique" destination ="#getdirectoryFromPath(expandPath('CFFileUpload.cfm'))#/Upload/" />