Solved

CFFILE access denied on copy

Posted on 2004-04-13
30
793 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
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
 
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

Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

728 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