ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Dell PowerEdge Servers
  #1  
Old November 12th, 2004, 10:14 PM
wingnut144 wingnut144 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 13 wingnut144 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Confused......

Ok, I set up a new site on my IIS server, running on Win2003. I had previously had other sites working with ColdFusion just fine. I am setting up this site so it uses default.cfm instead of the standard default.htm (or maybe not so standard!!).

My other sites are stored in a directory that is not under the wwwroot directory, and I've noticed that eventually a CFIDE folder appears, along with other CF folders, and at that time, CF works great.

I decided to take someones advice and put this new site in a folder inside the wwwroot folder. CF doesn't seem to be working. I have a section of code that is:

<cffile action="read" file="../TXT/News.txt" variable="News">
<cffile action="read" file="../TXT/News2.txt" variable="News2">
<cffile action="read" file="../TXT/News3.txt" variable="News3">

And lower on the page, have a:

<cfoutput>
#News# #News2# #News3#


</cfoutput>

When the page is displayed, when it gets to the variables, on the page I simply get #News#, and not the info in the variable.

Can anyone give a guy a hand?????

Thanks!
Steve

Reply With Quote
  #2  
Old November 14th, 2004, 09:10 AM
kiteless kiteless is offline
Moderator
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,494 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 18 h 41 m 47 sec
Reputation Power: 45
If it is a separate site in IIS you will need to add mappings for the .cfm extension to map this to the ColdFusion .dll files so that IIS knows what to do with the CF page.

http://www.macromedia.com/support/c..._cf_win2003.htm
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
  #3  
Old November 15th, 2004, 01:52 PM
wingnut144 wingnut144 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 13 wingnut144 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I moved the files to a CF site that I know works, and now I'm getting a error message of:

An error occurred when performing a file operation read on file C:\CFusionMX\runtime\servers\default\SERVER-INF\temp\wwwroot-tmp\../News.txt.
The cause of this exception was: java.io.FileNotFoundException: C:\CFusionMX\runtime\servers\default\SERVER-INF\temp\wwwroot-tmp\..\News.txt (The system cannot find the file specified).

The error occurred in C:\Web Sites\Scooter2\test1.cfm: line 5

3 : <title>Untitled Document</title>
4 : </head>
5 : <cffile action="read" file="../News.txt" variable="News">
6 : <cffile action="read" file="../News2.txt" variable="News2">
7 : <cffile action="read" file="../News3.txt" variable="News3">

The thing is my text file isn't in c:\CFusionMX\runtime\servers...etc file, they are in the root directory of the web site, that's why I have the path listed as ../News.txt

How can I get this to work?

Steve

Quote:
Originally Posted by kiteless
If it is a separate site in IIS you will need to add mappings for the .cfm extension to map this to the ColdFusion .dll files so that IIS knows what to do with the CF page.

http://www.macromedia.com/support/c..._cf_win2003.htm

Reply With Quote
  #4  
Old November 15th, 2004, 02:20 PM
kiteless kiteless is offline
Moderator
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,494 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 18 h 41 m 47 sec
Reputation Power: 45
Try using the full path, not ../. CF uses a temp directory (that you can see with the function getTempDirectory()), and it may be starting there. Use something like getCurrentTemplatePath() or getDirectoryFromPath() to hand CFFILE a full directory path.

Reply With Quote
  #5  
Old November 15th, 2004, 04:07 PM
wingnut144 wingnut144 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 13 wingnut144 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Can you provide what a sample of the code would look like with the getTempDirectory()) command would be, and how it hands that info to CF?

Thanks!!

Quote:
Originally Posted by kiteless
Try using the full path, not ../. CF uses a temp directory (that you can see with the function getTempDirectory()), and it may be starting there. Use something like getCurrentTemplatePath() or getDirectoryFromPath() to hand CFFILE a full directory path.

Reply With Quote
  #6  
Old November 15th, 2004, 04:28 PM
kiteless kiteless is offline
Moderator
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,494 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 18 h 41 m 47 sec
Reputation Power: 45
It's all in the docs.

<cfoutput>
#getTempDirectory()<br>
#getDirectoryFromPath( getCurrentTemplatePath() )#<br>
</cfoutput>

Reply With Quote
  #7  
Old November 15th, 2004, 07:53 PM
wingnut144 wingnut144 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 13 wingnut144 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I guess I'm a little confused why I'd want the TempDirectory() and DirectoryFromPath(getCurrentTemplatePath()) to run.

I get the idea that it will return the CF temp directory, what the temp is currently set to, and the DirectoryFromPath just returns the directory of the current templates. But how does that help? Since the files I want to read aren't in the directory that may be returned.

Steve

Quote:
Originally Posted by kiteless
It's all in the docs.

<cfoutput>
#getTempDirectory()<br>
#getDirectoryFromPath( getCurrentTemplatePath() )#<br>
</cfoutput>

Reply With Quote
  #8  
Old November 15th, 2004, 11:11 PM
kiteless kiteless is offline
Moderator
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,494 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 18 h 41 m 47 sec
Reputation Power: 45
I'm just showing you the functions so that you could try and see if that's why CF was looking in the wrong place when you wern't specifying a full path. One way or the other you will have to feed a full directory path to CFFILE. Whether you pass it a full path outright, or use functions like getTemplatePath(), expandPath(), or any of the other directory-related functions is up to you. But either way you'll need a means of determining the full path to the file. Take a look through the docs and find one or a combination that will work for you (there's always a way to do it, it just depends on what you need). Try #expandPath( '../news.txt' )# as a start.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Confused......


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway