Copy link to clipboard
Copied
I'm getting an error while trying to upload files. This works fine on our Production server, but the development server is where I'm getting the error.
Both servers are running Coldfusion 2023 Update 13 on Windows Server 2022. Attached is an example of the error I'm getting. I'm unsure what to check for here.
1 Correct answer
Thank you everyone for your help. It ended up being a folder sharing permission issue. I'm not the 'server guy' so he had to tinker with it to get it working.
Copy link to clipboard
Copied
The cause of the problem is likely to be the attribute:
destination="#application.files#"
The destination attribute must be a path to a directory. However, the value is currently a path to a file.
Copy link to clipboard
Copied
#application.files# is a variable with a value of \\srv-cfdev\stcnet1\branchcontrol\files\ which is a directory. hard-coding the directory path gives the same result.
Copy link to clipboard
Copied
Are you using ColdFusion's Virtual File System(VFS)?
Copy link to clipboard
Copied
I don't believe so, no.
Copy link to clipboard
Copied
Scratch, that. Yes, that option is enabled in the CF Admin.
Copy link to clipboard
Copied
To be clear, is "\\srv-cfdev\stcnet1\branchcontrol\files" a path on file system (for example, by means of a mapping srv-cfdev), a UNC network path or a path in the Virtual File System (ram://)?
Copy link to clipboard
Copied
It's a network path.
Copy link to clipboard
Copied
That might explain the difference:. Could it be that the path is defined in Production, but not in Development?
Copy link to clipboard
Copied
Nope. I mean, the path is different on production, the only difference is the server name. (srv-intranet vs srv-cfdev). Otherwise, they're exactly the same. CF Admin settings are all the same, so I'm leaning towards this being a server permissions issue.
Copy link to clipboard
Copied
I think you're right. Until now, I was going by your message 'file upload error "Error occurred while copying the file from source"'. After your last post I took another look at the attachment in your initial post.
There the error is clearly "Access Denied". You could therefore conclude that the PDF is uploaded, but ColdFusion's uploader does not have (network) access to the file.
First guess: check to make sure ColdFusion has suffcient Active Directory permissions.
Copy link to clipboard
Copied
So, I'm just following up here, and am not an expert with VFS in ColdFusion. @BKBK noted that it looked like you had it enabled, because the last line of your error dump references it. But this file path is not using VFS, which had me scratching my head. My guess would be that @BKBK is right and that the CF user account doesn't have permissions to read and write to it. By default, the CF user account is actually a security context, LocalSystem or SYSTEM, that has full privileges to the local machine but absolutely no privilege to network resources at all. So, check that out in your Services control panel. I'm not sure why VFS is coming up here, but it's in your error message.
Copy link to clipboard
Copied
Hi @presuhn1111 ,
Here is a suggestion for a test. It is to check whether file-access-permissions are indeed the cause of the issue.
- Store a test file, test.pdf, within the current directory.
- Run the following code in a CFM file.
- Verify whether the file is copied.
<cftry> <cfset source = expandPath('.') & '\' & 'test.pdf'> <cfset destination = "\\srv-cfdev\stcnet1\branchcontrol\files\testCopy.pdf"> <cfset filecopy(source, destination)> Does destination file exist? Answer: <cfoutput>#fileExists(destination)#</cfoutput> <cfcatch type="any"> <cfdump var="#cfcatch#"> </cfcatch> </cftry> ​
Copy link to clipboard
Copied
Thank you everyone for your help. It ended up being a folder sharing permission issue. I'm not the 'server guy' so he had to tinker with it to get it working.
Copy link to clipboard
Copied
Thanks for the update and for sharing the solution.

