Solved

Access is denied (error 5) in CFFile

Posted on 2004-09-06
5
1,001 Views
Last Modified: 2013-12-24
Hi Guys!

I'm getting this error:

Error processing CFFILE Unable to copy file 'C:\Temp\_AM\customers\com_add_dts_connection.cfm' to path 'C:\Temp\_AM\activities'. Error: Access is denied. (error 5).The error occurred while processing an element with a general identifier of (CFFILE), occupying document position (86:6) to (86:81) in the template file C:\INETPUB\WWWROOT\HHSS_ROOT\_PM\DBABBITT-TEST\NOTEPAD.CFM.

My web root is C:\INETPUB\WWWROOT\HHSS_ROOT\

I am using IIS and CF Server. Here is the version dump:
Server Product: ColdFusion Server
Version: 5, 0, 0, 0
Edition: Enterprise
Operating System: Windows NT
OS Version: 5.0, Service Pack 4
OS Build Number: 2195

Here is the offending tag:
<cffile action="COPY" source="#CopySource#" destination="#CopyDestination#">

If I change it to this:
&lt;cffile action="COPY" source="#CopySource#" destination="#CopyDestination#"&gt;<cfabort>

It outputs like this:
<cffile action="COPY" source="C:\Temp\_AM\customers\com_add_dts_connection.cfm" destination="C:\Temp\_AM\activities">

How do I get rid of the Access Denied error?
0
Comment
Question by:dbabbitt
5 Comments
 
LVL 18

Expert Comment

by:Plucka
ID: 11993496
Hi dbabbitt,

Right click on the document and ensure that user everyone has full permisions.

This type of error normally occurs when the file has been copied from somewhere else and the permissions are invalid for the current machine.

Regards
Plucka
0
 
LVL 14

Expert Comment

by:Renante Entera
ID: 11993512
Hello dbabbitt!

How about adding an attribute to the <cffile>.

So you will have your code like this :

<cffile action="COPY" source="C:\Temp\_AM\customers\com_add_dts_connection.cfm" destination="C:\Temp\_AM\activities" mode="777">

Note : Be sure that source exists and the destination has been created.

For your reference on <cffile action="copy">, visit this site :
   
   http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/tags-p29.htm#wp3542558


Goodluck!
eNTRANCE2002 :-)
0
 
LVL 17

Accepted Solution

by:
anandkp earned 500 total points
ID: 11994406
DESTINATION
Required. 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. On Windows, use the backward slash (\). On UNIX, use the forward slash (/).

so as u can see ur code shld look like
<cffile action="COPY" source="C:\Temp\_AM\customers\com_add_dts_connection.cfm" destination="C:\Temp\_AM\activities\">

PS : note the TRAILING slash for destination ...

K'Rgds
Anand
0
 

Author Comment

by:dbabbitt
ID: 11995029
One tiny change did the trick:
<cffile action="COPY" source="#CopySource#" destination="#CopyDestination#\">
0
 
LVL 17

Expert Comment

by:anandkp
ID: 11995106
way to go :)
0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

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

24 Experts available now in Live!

Get 1:1 Help Now