Solved

CFFILE access denied on copy

Posted on 2004-04-13
30
778 Views
Last Modified: 2013-12-24
I have read several threads about this, followed the suggestions, and have not been able to solve this problem.

An exception occurred when performing a file operation copy on files \\main\clients\Clients.xls and \\server2\Clients.  When running:

<cffile action="copy" source="\\main\clients\Clients.xls" destination="\\server2\Clients" nameconflict="overwrite">

I get an error:

The cause of this exception was: java.io.FileNotFoundException: \\server2\Clients (Access is denied).  

I have checked permissions and they seem to be fine.  How can I verify which user Cold Fusion server is running under?
0
Comment
Question by:theamzngq
  • 15
  • 8
  • 3
  • +3
30 Comments
 
LVL 35

Expert Comment

by:mrichmon
ID: 10815989
Did you try putting a trailing slash on the destination :

<cffile action="copy" source="\\main\clients\Clients.xls" destination="\\server2\Clients\" nameconflict="overwrite">

Or specifying the filename at the destination since you have nameconflict to overwrite :

<cffile action="copy" source="\\main\clients\Clients.xls" destination="\\server2\Clients\Clients.xls" nameconflict="overwrite">
0
 
LVL 11

Expert Comment

by:adonis1976
ID: 10816032
the destination should be

\\server2\clients\

you are missing a "\"
0
 
LVL 2

Author Comment

by:theamzngq
ID: 10816042
adding a slash on the destination gave me an 'invalid destination' error.  Adding the name of the file in the destination gave the same access denied error.

What about verifying the user that cold fusion is logged in as?

The reason I am trying this is because my original solution (that worked before I installed Server 2003) was to operate directly on the file where it was, on server2.  I was unable to add it as a datasource in CF admin.  So, since I haven't been able to figure that out, I'm trying to connect to the spreadsheet locally, then copy it to its original location.  Its a crappy fix, but I can't get it to connect properly as a datasource.
0
 
LVL 2

Author Comment

by:theamzngq
ID: 10816053
here is the error with the slash:

Attribute validation error for tag CFFILE.  
The value of the attribute destination, which is currently "\\server2\clients\", is invalid.  
 
The error occurred in D:\CFusionMX\wwwroot\Wright_2.0\Clients-m2s.cfm: line 1
 
1 : <cffile action="copy" source="\\main\clients\Clients.xls" destination="\\server2\clients\" nameconflict="overwrite">
--------------------------------------------------------------------------------
 
0
 
LVL 11

Expert Comment

by:adonis1976
ID: 10816112
can you get to the folder clients on the destination server(server2) by typing the UNC path? say like\\server2\clients\

the fix i was talking about was from here

http://www.macromedia.com/support/coldfusion/ts/documents/tn17171.htm
0
 
LVL 2

Author Comment

by:theamzngq
ID: 10816126
Yes, I can, from both my local machine, and the machine that is running the CF server.
0
 
LVL 35

Expert Comment

by:mrichmon
ID: 10816135
If it is Win2K3 then you should check the permissions of the user as you suspected.  See if the user has permissions to write to the clients directory on the win2k3 server.

I think that since you are having trouble creating a datasource - this problem is related.  It sounds like a permissions issue...
0
 
LVL 2

Author Comment

by:theamzngq
ID: 10816140
that post your link refers to was last updated in 1998...
0
 
LVL 2

Author Comment

by:theamzngq
ID: 10816147
where can I check which user the CF server is using?
0
 
LVL 11

Expert Comment

by:adonis1976
ID: 10816197
on the folder "clients" on server2, does everyone has full access ? right click on the folder and go to properties and check for permission.. click on the special permissions button on the bottom and check if there is something that is stopping it..
0
 
LVL 11

Expert Comment

by:adonis1976
ID: 10816216
cfserver.exe uses local system account..
0
 
LVL 2

Author Comment

by:theamzngq
ID: 10816257
What if the server is not logged on by anyone?

Server2, btw, is running W2K, while Main is running 2K3.

Ok, new development.  I went into Services, and changed the account that all Cold Fusion services log in as to Administrator.  That allowed the code to run.  However, I was logged in as Administrator previously as well.  That also did not allow me to connect directly to the spreadsheet as an ODBC datasource, as I could before W2K3.
0
 
LVL 11

Expert Comment

by:adonis1976
ID: 10816327
u cant connect to excel spreadsheet as ODBC even as an administrator???
0
 
LVL 2

Author Comment

by:theamzngq
ID: 10816357
Once I create a System DSN on MAIN, and then go the CF admin page and try to add a datasource using the System DSN, I get:

Connection verification failed for data source: xlsclients
[]java.sql.SQLException: [Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Excel Driver] '(unknown)' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.
The root cause was that: java.sql.SQLException: [Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Excel Driver] '(unknown)' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.

All these services, as I mentioned, were assigned to log on as the domain administrator account.  They have all been restarted as well.
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 2

Author Comment

by:theamzngq
ID: 10816370
It all worked in W2K before I formatted and reinstalled everything on W2K3.
0
 
LVL 35

Expert Comment

by:mrichmon
ID: 10816391
Okay this definately points to a permissions problem.

It should not matter if anyone is logged into the server - that is why it uses a local system account.  You need to make sure that the local system account that is used has the appropriate priviladges for those services.

Also for the datasource issue it again is related to the differences in permissions.  If you are using IIS as your webserver then you need to know that there are differneces in the permissions that IIS 5 has (win 2000) and IIS 6 has (win 2003).

You need to make sure that the website user has the appropriate permissions.  The website user is usually called something like IUSR_

But you want to be careful about what permissions you grant to this user account.
0
 
LVL 11

Expert Comment

by:adonis1976
ID: 10816395
try to do this on w2k3 server..

instead of using CF admin, go to Control Panel --> Admin tools --> Data Sources(ODBC).. click ont he System DSN tab on the top and then add the DSN.. then open up the CF admin and see if it appears there.. then click on the Verify button to see if it is ok..
0
 
LVL 11

Expert Comment

by:adonis1976
ID: 10816397
let me know what happens..
0
 
LVL 2

Author Comment

by:theamzngq
ID: 10816414
Ok, so guide me through this, lets go step by step, if possible.  Where and what should I check first?
0
 
LVL 2

Author Comment

by:theamzngq
ID: 10816429
btw, I am using AD, and the account I set the CF services log on is the domain administrator account.  This is also the account I am logged in with while trying to add System DSN for this spreadsheet.
0
 
LVL 2

Author Comment

by:theamzngq
ID: 10816484
I believe I have done exactly what you have described several times.  I have added a System DSN using Data Source(ODBC).  I have then opened up CF admin, attempted to add a new datasource of type: ODBC socket.  Upon trying to submit the changes, I get the above mentioned error.

Is there another way to verify the existance of an ODBC datasource besides adding a new one and submitting it?
0
 
LVL 11

Expert Comment

by:adonis1976
ID: 10816507
once u add the system DSN using the "DataSources" under Admin tools, the DSN should automatically listed in the CF admin console.. u dont have to do anything.. is the DSN listed in the CF admin after you add it thru windows?
0
 
LVL 2

Author Comment

by:theamzngq
ID: 10816924
I have not seen what you are talking about.  All I am aware of is the Data Sources section on the CF admin web page.
0
 
LVL 2

Expert Comment

by:fmedia
ID: 10817154
Unlike adonis1976 said, if this is cfmx ( wich it is ) there is no cfserver.exe, cfmx creates a jrun instance, wich if you look in the process list, it displays jrun.exe, wich usually runs on the SYSTEM account.

BTW theamzngq, could you post here the full java stack ?

regards,
idss
0
 
LVL 2

Author Comment

by:theamzngq
ID: 10817446
Yes, this is CFMX 6.1, sorry if I didn't mention that before.  It is running on W2K3.

As far as the error on the file copy, I overcame it by changing the CF services to log on as the domain administrator account.  I still cannot connect successfully to the spreadsheet on Server2.

Which java stack were you referring to, fmedia?
0
 
LVL 17

Expert Comment

by:anandkp
ID: 10820135
Hi ...

SOURCE  : The full path name of the file to copy. [\\main\clients\Clients.xls]

DESTINATION : The full path name of the directory where the copy of the file will be saved. If you do not specify a file name, you must include the trailing slash. [\\server2\Clients\]

Few check points [assuming u have all the permissions on W2K3] :
1. Check if the CFAdmin allows u to use CFFILE
2. if u can access the \\server2\Clients\Clients.xls from ur local machine - try mapping this folder on the Server1 & then try again.

let me know ...

K'Rgds
Anand
0
 
LVL 2

Author Comment

by:theamzngq
ID: 10824053
As my post above says:

"adding a slash on the destination gave me an 'invalid destination' error.  here is the error with the slash:

Attribute validation error for tag CFFILE.  
The value of the attribute destination, which is currently "\\server2\clients\", is invalid.  
 
The error occurred in D:\CFusionMX\wwwroot\Wright_2.0\Clients-m2s.cfm: line 1
 
1 : <cffile action="copy" source="\\main\clients\Clients.xls" destination="\\server2\clients\" nameconflict="overwrite">"

And again, as another of my posts above says again:

"As far as the error on the file copy, I overcame it by changing the CF services to log on as the domain administrator account."

It works now with the following code:
<cffile action="copy" source="\\main\clients\Clients.xls" destination="\\server2\clients" nameconflict="overwrite">
0
 
LVL 2

Author Comment

by:theamzngq
ID: 11089569
no one seems to know what is up with this, please refund
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 11190671
PAQed, with points refunded (500)

Computer101
E-E Admin
0

Featured Post

Scale it in WD Gold

With up to ten times the workload capacity of desktop drives, WD Gold hard drives employ advanced technology to deliver among the best in reliability, capacity, power efficiency and performance.

Join & Write a Comment

Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now