Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error with cffile read

Status
Not open for further replies.

doyle9732

Programmer
Apr 12, 2002
185
0
0
CA
This problem has me stumped....I've tried everything in my bag of tricks and everything has failed.

I have a client (ok, my boyfriend's work) who have the Coldfusion MX Developer version 7,0,0,91690.

I am trying to read a file that is located in the same folder as the file that is calling it. This is the code:

<cffile action="READ" file="\\crunch\Ascent\Magazine.tpm" variable="TextInput">

I wrote this code on a different server (ok, my work) and it worked perfectly. But on the crunch server it throws this error:

An error occurred when performing a file operation READ on file \\crunch\Ascent\Magazine.tpm.
The cause of this exception was: java.io.FileNotFoundException: \\crunch\Ascent\Magazine.tpm (Access is denied).

I have tried referring to it by its IP address, I have enabled the security (I'm not running 7 at my work, so its a bit different), but either on or off it still throws the error except sometimes it starts with 'security:'. I have given the user 'system' full control of the folder/files. I have tried reading a .txt and .cfm file and they also throw an error.

I convinced them to use CF, and now weeks later, the code is still not up and running and I'm looking and feeling like a fool. :-(

Does anyone have any suggestions? It seems to be a network/security issue and that's out of my league....

thanks!
Stephanie
 
When you say you have give the user 'system' full control of the folder/files which user are you referring to? Coldfusion itself will need to run under an account which has access to this path.

See
for more info

also this older doc
from the cf5 docs mentions:

"By default in Windows NT, you run ColdFusion under the System Account. However, if you try to connect to a file-based database over the network using a System Account, then you get insufficient permission errors. You must run ColdFusion Application Server under a Domain User Account that has permission to run ColdFusion and has permission to read and write to the mdb file."

One way I have done this without having to mess around with the permmisions of coldfusion is to use CFFTP instead. if this is an option , be aware of any security issues (such as hardcoding ftp password in source code etc.)

HTH
 
well, I tried following the instructions on the link, and the error message has changed to 'page cannot be displayed' and as an added bonus, I've screwed things up so badly that my cf administrator no longer works either. I am uninstalling and reinstalling and hopefully I will see something during the install that will lead me where I need to go.....at this point, I'd be happy to get back to the read error! :-s

a very deflated
Stephanie
 
I have uninstalled and reinstalled CF. And it still isn't working. Someone suggested if it's a permissions issue, that I should start with full permissions for all and then slowly work backwards until I find which user is the problem. Why is it that I'm changing permissions and sometimes get this error:
An error occurred when performing a file operation READ on file \\192.168.0.129\Magazine.tpm.
The cause of this exception was: java.io.FileNotFoundException: \\192.168.0.129\Magazine.tpm (The network path was not found).

then other times, instead of (The network path was not found), I get (access was denied)

Maybe if I understood that, I'd be closer to getting this fixed?!

Also, if CF isn't 'system', how on earth do I add a user as CF? I get very nervous add/changing stuff like this.

help!
Stephanie
 
Why are you trying to read the file over the network if it is on the same machine?

Change the path to your file or change CF to run under an account with network access. Change CF to run under an Administrator account just to see if it works then.

Hope this helps

Wullie

Fresh Look - Quality Coldfusion/Windows Hosting

The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
When I refer to the file like this:
<cffile action="READ" file="Magazine.tpm" variable="TextInput">

I get this error:
An error occurred when performing a file operation READ on file C:\CFusionMX7\runtime\servers\coldfusion\SERVER-INF\temp\The cause of this exception was: java.io.FileNotFoundException: C:\CFusionMX7\runtime\servers\coldfusion\SERVER-INF\temp\ (The system cannot find the file specified).

So, I know I have to refer to it as this:
<cffile action="READ" file="\\CRUNCH\ascent\Magazine.tpm" variable="TextInput"> (whether I use the computer name, or the IP nothing works)

You said: change CF to run under an account with network access

that is what I was trying to do with the suggested link above, but I really don't know enough about network administrations......I did try and ended up screwing it up so badly my cfide/adminstration area stopped working. So I uninstalled and reinstalled.

is there a FAQ on changing CF to run under an account? I obviously didn't fare well with the instructions above :-(

Stephanie
 
There is nothing to changing an account. All you do is enter a username and password. If you broke the CF Admin, this cannot possibly be related to you altering the account to use something else. If it was then all you need to do is switch a radio button option and it would go back to using SYSTEM.

Regarding the paths, you have it all wrong. \\server\ is what you would use if you were connecting from 1 server to another. If you are connecting to the same server, you use the system filepath:

Code:
<cffile action="READ" file="C:\ascent\Magazine.tpm" variable="TextInput">

Hope this helps

Wullie

Fresh Look - Quality Coldfusion/Windows Hosting

The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
I tried the cffile above and got this error:
An error occurred when performing a file operation READ on file C:\ascent\Magazine.tpm.
The cause of this exception was: java.io.FileNotFoundException: C:\ascent\Magazine.tpm (The system cannot find the path specified).

Is this not a permission issue? How can I make CF the 'system' user? That is how it works at my work. I added the user system and gave it full control, but still it throws an error.

Stephanie
 
what platforform is the OS? if it isn't windows chances are the filename is case sensative. is the name of the file actually :Magazine.tpm: (capital M followed by all lowercase?)

We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
 
it is running on XP, with Apache as the web server. The file name (being read as input) is in the same folder as the calling file and is Magazine.tpm. I have set the permissions to 'full control' on the folder, including full control for 'system'. I just don't think coldfusion is the user system.
Stephanie
 
it is running on XP, with Apache as the web server. The file name (being read as input) is in the same folder as the calling file and is Magazine.tpm

In the address bar of XP, enter:

C:\ascent\Magazine.tpm

What happens?

If the file doesn't attempt to open, go from the root of the C drive and list here the name of every folder (in order) you need to open before you reach that file.

Hope this helps

Wullie

Fresh Look - Quality Coldfusion/Windows Hosting

The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
it says:

Cannot find 'file:///c:/ascent/magazine.tpm

the path is all the defaults.....c:\program files\apache group\apache2\htdoc\ascent\Magazine.tpm

an optimistic Stephanie???
 
I'm not understanding. I thought that when I installed Apache, I set the path to:
c:/program files/apache group/apache2/htdoc so that the computer name, in this case 'crunch', was the equivalent of that path.....so by doing crunch/ascent/Magazine.tpm I was in effect telling it:
c:/program files/apache group/apache2/htdocs/ascent/Magazine.tpm

Are the spaces in some of those file names giving me grief?
Stephanie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top