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

CFHTTP Error

LEGEND ,
Aug 27, 2007 Aug 27, 2007

Copy link to clipboard

Copied

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


TOPICS
Advanced techniques

Views

625

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
Guest
Aug 27, 2007 Aug 27, 2007

Copy link to clipboard

Copied

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

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
LEGEND ,
Aug 27, 2007 Aug 27, 2007

Copy link to clipboard

Copied

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.


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
LEGEND ,
Aug 27, 2007 Aug 27, 2007

Copy link to clipboard

Copied

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"/>



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
LEGEND ,
Aug 27, 2007 Aug 27, 2007

Copy link to clipboard

Copied

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?


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
LEGEND ,
Aug 27, 2007 Aug 27, 2007

Copy link to clipboard

Copied

LATEST
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 🙂


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