Reading a file

This is a discussion on Reading a file within the Cold Fusion forums in Application Servers & Tools category; I have a text file on a W2K file server on my network that I need to retrieve by a ColdFusion Server on the same network how might I accomplish this? I have tried this. <cffile action="read" file="Z:\my_data.txt" variable="myData" /> An error occurred when performing a file operation read on file Z:\my_data.txt. The cause of this exception was: java.io.FileNotFoundException: Z:\my_data.txt (The system cannot find the path specified). I have tried this. <cfscript> oFile = FileOpen("Z:\my_data.txt", "read"); </cfscript> I have Tried the server name and IP like this. <cfscript> oFile = FileOpen("D:\192.168.1.10\Public\Installs\my_data. txt", "read"); </cfscript>...

Go Back   Application Development Forum > Application Servers & Tools > Cold Fusion

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 09-07-2008, 08:46 AM
murpg
Guest
 
Default Reading a file

I have a text file on a W2K file server on my network that I need to retrieve
by a ColdFusion Server on the same network how might I accomplish this?

I have tried this.
<cffile action="read" file="Z:\my_data.txt" variable="myData" />
An error occurred when performing a file operation read on file
Z:\my_data.txt.
The cause of this exception was: java.io.FileNotFoundException: Z:\my_data.txt
(The system cannot find the path specified).
I have tried this.
<cfscript>
oFile = FileOpen("Z:\my_data.txt", "read");
</cfscript>
I have Tried the server name and IP like this.
<cfscript>
oFile = FileOpen("D:\192.168.1.10\Public\Installs\my_data. txt", "read");
</cfscript>

Reply With Quote
  #2  
Old 09-07-2008, 11:04 AM
editcorp
Guest
 
Default Re: Reading a file

My guess is that you do not have the 'Z' drive mapped on the CF server. On
your second example, the UNC name isn't formatted quite right. Instead of the
'D:\' in front of the IP address, try '\\' instead. So assuming you have a
share on that server named 'Public', try using:
"\\192.168.1.10\Public\Installs\my_data.txt"



Reply With Quote
  #3  
Old 09-07-2008, 11:16 AM
murpg
Guest
 
Default Re: Reading a file

Thanks, I tried that but it says that the file cannot be found. I also tried
oFile = FileOpen("\\designsbg\Public\Installs\my_data.txt" , "read");
AND
oFile = FileOpen("\\designsbg\Installs\my_data.txt", "read");
And with the IP Address
The folder that is shared is Installs.

Reply With Quote
  #4  
Old 09-07-2008, 11:18 AM
murpg
Guest
 
Default Re: Reading a file

When I map a drive inside my network ii is always \\designsbg\installs
to reach that folder.
Reply With Quote
  #5  
Old 09-07-2008, 11:27 AM
murpg
Guest
 
Default Re: Reading a file

I got it to work thanks.
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 06:41 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.