5 Replies Latest reply on May 25, 2006 6:57 AM by PackinDaMAC

    <cffile>

    PackinDaMAC Level 1
      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.....
        • 1. Re: &lt;cffile&gt;
          Abinidi Level 1
          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.
          • 2. Re: &lt;cffile&gt;
            PackinDaMAC Level 1
            <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
            • 3. Re: &lt;cffile&gt;
              Mr Black Level 1
              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....
              • 4. Re: &lt;cffile&gt;
                PackinDaMAC Level 1
                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?????
                • 5. Re: &lt;cffile&gt;
                  PackinDaMAC Level 1

                  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