• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

<cffile>

Participant ,
May 24, 2006 May 24, 2006

Copy link to clipboard

Copied

I want to know if the <cffile> tag creates a file then writes the inforation to it...Because when i run my application it does not right the values of my varibles to the msg.txt which is my file and i dont know why....Is there something i am doing wrong.....
TOPICS
Advanced techniques

Views

388

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 24, 2006 May 24, 2006

Copy link to clipboard

Copied

What happens if you hardcode it for testing?

<cffile action="write" file="D:\PhoneReminder\msg.txt" output="This is a test">

does it create the file? if not then you may have a permissions issue.

Also try outputing the variables to see if they are even being defined first. If not, then it will not create it either.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 24, 2006 May 24, 2006

Copy link to clipboard

Copied

<cffile action="write" file="c:\msg.txt" output="This is a Test">

No this does not create a file and it does not write anything if i create it before i execute my web app......any help

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 24, 2006 May 24, 2006

Copy link to clipboard

Copied

As about your first example, it is wrong. You cannot use <cffile action="write"... inside a loop, since action"write" creates a new file every time. You need to take <cffile action="write"... out of the loop and create, let's say an empty file. Use <cffile action="append"... inside the loop.

"No this does not create a file and it does not write anything if i create it before i execute my web app......any help"

Kinda difficult to understand the meaning of this. If file is not created, you should get an error, at least....

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 25, 2006 May 25, 2006

Copy link to clipboard

Copied

You right Mr.Black i dont get an error but the page still loads.....The comment was stated before due to the fact that i changed my ouput to "This is a test " and it worked fine....How do i make sure all my varibles are defined when they are ready to be used?????

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 25, 2006 May 25, 2006

Copy link to clipboard

Copied

LATEST

I have a <input type="checkbox" name="mcall"> my page looks like this in the browser
<table>
<tr>

<td>Name Address State checkbox</td>
<td>Name Address State checkbox</td>
<td>Name Address State checkbox</td>

</tr>
</table>
Now I want to check the checkbox's and write to a file only the <td> that are checked....I know it can go like

<cfif mcall.checked = true>
<cffile action = "write" file="c:\msg.txt" addnewline="yes" output="What should be my ouput???????">

But i am not sure how to structure the code syntax any help would be great ...or any place where i can find help would be great too thanks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation