5 Replies Latest reply on Aug 27, 2007 2:46 PM by Newsgroup_User

    CFHTTP Error

    Level 7
      I am attempting to loop trough a txt file and loop the entries into a
      database. The file is delimited by a pipe '|' but when I attempt it, I get:

      Incorrect number of columns in row.
      Verify the number of columns specified in the columns attribute and in the
      target file

      The error occurred in wwwroot\test.cfm Line 3

      Line 3 being the cfhttpparam type="Header" name="TE", but if I remove it, I
      get an error in the main CFHTTP line (1).

      After googling for a while I found a site that mentions that if the file has
      a carriage return, you can get this error. Is there a way to remove the
      carriage return or am I missing something else. Below is my code for the
      CFHTTP.

      <cfhttp name="Property"
      url=" http://www.bpoprosonline.com/assets/property/idxrs082607.txt"
      delimiter="|" method="get">
      <cfhttpparam type="Header" name="Accept-Encoding" value="deflate;q=0">
      <cfhttpparam type="Header" name="TE" value="deflate;q=0">
      </cfhttp>

      If you want to see the file, you can use the URL link above to link to my
      sample txt file.

      Thanks.

      --
      Wally Kolcz
      MyNextPet.org
      Founder / Developer
      586.871.4126


        • 1. Re: CFHTTP Error
          ALAKAN
          Wally,
          I faced a similar problem while reading a text file using Python language it has something with the encoding format.Once I changed to "utf-8" character mode to read the file it was solved. Try reading the file in utf-8 format or set the mimetype to text/html using the cfhttpparam.

          I exactly don't know how to do using CFML but its certainly some problem with encoding of file.

          Thx
          AL
          • 2. Re: CFHTTP Error
            Level 7
            Does anyone know how to do that. I have been trying now for about 20 minutes
            and I keep getting errors.

            I tried:
            <cfhttpparam type="FILE" name="file"
            file="E:\webs\bpoprosonline.com\assets\property\idxrs082607.txt"
            mimetype="text/html"/>

            But I get that the file specified cannot be found, even though I have tested
            it many times.


            • 3. Re: CFHTTP Error
              Level 7
              I also tried this and got the same error:

              <cfhttpparam type="FILE" name="idxrs082607.txt"
              file="E:\webs\bpoprosonline.com\assets\property" mimetype="text/html"/>



              • 4. Re: CFHTTP Error
                Level 7
                I figured out my own stupidity on that one, but when I added the cfhttpparam
                and pointed it to the file, I then got the error:

                Incorrect number of columns in row.
                Verify the number of columns specified in the columns attribute and in the
                target file

                How can I get CF to ignore the other columns and only show use the ones I
                want or can't it?


                • 5. Re: CFHTTP Error
                  Level 7
                  Nevermind, I made it way more dificult that it needed to be. Just used a
                  simple cfhttp request and it seems to be working. Just a stupid SQL error
                  now :)