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

cfhttp problem reading file

LEGEND ,
Mar 26, 2007 Mar 26, 2007

Copy link to clipboard

Copied

Hi there,

The code below works fine on my local host computer and databse setup.
cfhttp will read my file fine and output the number of rows.


When i attempt to run this code on my web host's CF and MS II's server i get
a - HTTP 500 - Internal server error in Internet Explorer and a blank page
in firefox.


Does anybody know why this would be happenning. I've heard cfhttp has some
bugs but i couldnt find a solution after looking at various blogs on the
matter. Not sure if its timing out or what?



<cfsetting requesttimeout="900">

<cfhttp method="get" textqualifier=" " firstrowasheaders="no" delimiter="|"
name="test" columns="OrderNo, Line, seq, AccountNo, Shipment, Invoice,
PurchaseOrder, Completed, OrderDate, ShipmentDate, Backorder, Product,
QtyOrdered, QtyShipped, QtyInvoiced, Price, Carrier, Connote, Delivery1,
Delivery2, Delivery3, Delivery4, Delivery5, Delivery6, Delivery7, expected"
url=" http://xxxxxx.com/xxx/zzzzz.txt">

Read in <cfoutput>#test.RecordCount#</cfoutput> records


TOPICS
Advanced techniques

Views

515

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
Mar 27, 2007 Mar 27, 2007

Copy link to clipboard

Copied

You need </CFHTTP> after your <CFHTTP>.

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 ,
Mar 27, 2007 Mar 27, 2007

Copy link to clipboard

Copied

Heres my complete code what im trying to achieve. In IE i get a http 500
internal error and in firefox i get a blank page. im strating to think it
may be a database permission problem although i have made sure my user has
full permissions on the order_history table.

any ideas whta im doing wrong?




<cfquery name="delete" datasource="#client.dsn#"
username="#client.username#" passWord="#client.password#">
delete from order_history
</cfquery>

<cfhttp timeout="900" method="get" textqualifier=" " firstrowasheaders="no"
columns="OrderNo,Line,seq,AccountNo,Shipment,Invoice,PurchaseOrder,Completed,OrderDate,ShipmentDate,Backorder,Product,QtyOrdered,QtyShipped,QtyInvoiced,Price,Carrier,Connote,Delivery1,Delivery2,Delivery3,Delivery4,Delivery5,Delivery6,Delivery7,expected"
delimiter="|" name="test" url=" http://xxxxxxxx.com/prms/ordhist1.txt">
</cfhttp>

<cfloop query="test">

<cfquery name="insert" datasource="#client.dsn#"
username="#client.username#" passWord="#client.password#">
INSERT INTO order_history
(OrderNo, Line, seq, AccountNo, Shipment, Invoice, PurchaseOrder, Completed,
OrderDate, ShipmentDate, Backorder, Product, QtyOrdered, QtyShipped,
QtyInvoiced, Price, Carrier, Connote, Delivery1, Delivery2, Delivery3,
Delivery4, Delivery5, Delivery6, Delivery7, expected)
VALUES (
<cfqueryparam value='#test.OrderNo#' cfsqltype="cf_sql_integer">,
<cfqueryparam value='#test.Line#' cfsqltype="cf_sql_integer">,
<cfqueryparam value='#test.seq#' cfsqltype="cf_sql_integer">,
<cfqueryparam value='#test.AccountNo#' cfsqltype="cf_sql_integer">,
<cfqueryparam value='#test.shipment#' cfsqltype="cf_sql_integer">,
<cfqueryparam value='#test.invoice#' cfsqltype="cf_sql_integer">,
<cfqueryparam value='#test.purchaseorder#' cfsqltype="cf_sql_varchar"
maxlength="20">,
<cfqueryparam value='#test.completed#' cfsqltype="cf_sql_varchar"
maxlength="12">,
<cfqueryparam value='#test.orderdate#' cfsqltype="cf_sql_varchar"
maxlength="12">,
<cfqueryparam value='#test.shipmentdate#' cfsqltype="cf_sql_varchar"
maxlength="12">,
<cfqueryparam value='#test.backorder#' cfsqltype="cf_sql_varchar"
maxlength="10">,
<cfqueryparam value='#test.product#' cfsqltype="cf_sql_varchar"
maxlength="20">,
<cfqueryparam value='#test.qtyordered#' cfsqltype="cf_sql_integer">,
<cfqueryparam value='#test.qtyshipped#' cfsqltype="cf_sql_integer">,
<cfqueryparam value='#test.qtyinvoiced#' cfsqltype="cf_sql_integer">,
<cfqueryparam value='#test.price#' cfsqltype="cf_sql_varchar"
maxlength="15">,
<cfqueryparam value='#test.carrier#' cfsqltype="cf_sql_varchar"
maxlength="20">,
<cfqueryparam value='#test.connote#' cfsqltype="cf_sql_varchar"
maxlength="20">,
<cfqueryparam value='#test.delivery1#' cfsqltype="cf_sql_varchar"
maxlength="150">,
<cfqueryparam value='#test.delivery2#' cfsqltype="cf_sql_varchar"
maxlength="100">,
<cfqueryparam value='#test.delivery3#' cfsqltype="cf_sql_varchar"
maxlength="100">,
<cfqueryparam value='#test.delivery4#' cfsqltype="cf_sql_varchar"
maxlength="100">,
<cfqueryparam value='#test.delivery5#' cfsqltype="cf_sql_varchar"
maxlength="100">,
<cfqueryparam value='#test.delivery6#' cfsqltype="cf_sql_varchar"
maxlength="100">,
<cfqueryparam value='#test.delivery7#' cfsqltype="cf_sql_varchar"
maxlength="100">,
<cfqueryparam value='#test.expected#' cfsqltype="cf_sql_varchar"
maxlength="12">)

</cfquery>

</cfloop>

FINISHED!!



"jdeline" <jdeline@deline.com> wrote in message
news:eub244$lc$1@forums.macromedia.com...
> You need </CFHTTP> after your <CFHTTP>.


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
Guest
Mar 28, 2007 Mar 28, 2007

Copy link to clipboard

Copied

I presume you have double-checked the data types of all columns and that the CFSQLTYPEs are correct. I seem to remember that there was a problem with CFSQLTYPE in an earlier version of ColdFusion. What version and platform are you using?

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 ,
Mar 28, 2007 Mar 28, 2007

Copy link to clipboard

Copied

i'll check it out using MX7 on a II's server


"jdeline" <jdeline@deline.com> wrote in message
news:eudm61$e7m$1@forums.macromedia.com...
>I presume you have double-checked the data types of all columns and that
>the
> CFSQLTYPEs are correct. I seem to remember that there was a problem with
> CFSQLTYPE in an earlier version of ColdFusion. What version and platform
> are
> you using?
>


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
Advocate ,
Mar 29, 2007 Mar 29, 2007

Copy link to clipboard

Copied

What result are you getting if you perform a <cfump> of your CFHTTP variables?

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 ,
Mar 29, 2007 Mar 29, 2007

Copy link to clipboard

Copied

Thanks for help guys it seems to be a file size problem.

the text file I was reading was 25mb and cfhttp seems to die, as it loads it
into a query set.

Under 20mb and my code seems to work ok.


"insuractive" <webforumsuser@macromedia.com> wrote in message
news:euh4ml$1mq$1@forums.macromedia.com...
> What result are you getting if you perform a <cfump> of your CFHTTP
> variables?


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
Guest
Mar 30, 2007 Mar 30, 2007

Copy link to clipboard

Copied

LATEST
Check out the DFxChange at http://www.cfxchange.com/?content=tagdetails&area=gallery&subarea=details&tag=200&querystring=. I've used this custom tag before and it seems to handle large files quite nicely.

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