Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

resume failed download, CFHTTP

Posted on 2007-03-27
10
Medium Priority
?
952 Views
Last Modified: 2013-12-24
i'm trying to download a huge(i mean really huge, like 60MB) xml from a server to local using CFHTTP. but it failed and message from cf server is:

'The request has exceeded the allowable time limit Tag: cfhttp'.

how can i RESUME the file(broken download previously), instead of re-download it again?

my code:
-------------------------------------
<cfif NOT FileExists(DIRECTORY_XMLData & FILENAME_thisXML)>

<cfhttp
method="Get"
URL="#source_server#"
file="#FILENAME_thisXML#"
path="#DIRECTORY_XMLData#"
timeout="False" />

<cfset XMLPARSE_thisfile = DIRECTORY_XMLData & FILENAME_thisXML>

</cfif>
0
Comment
Question by:liewsin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
10 Comments
 
LVL 36

Accepted Solution

by:
SidFishes earned 1000 total points
ID: 18799962
afaik , you can't

You can mess with the timeout attribute to prevent the failure. Sounds like one must be set somewhere or it would wait forever without TO.


"Value, in seconds, that is the maximum time the request can take. If the timeout passes without a response, ColdFusion considers the request to have failed.

If the client specifies a timeout in the URL search parameter (for example, ?RequestTime=120) ColdFusion uses the lesser of the URL timeout and the timeout attribute value; this ensures that the request times out before, or at the same time as, the page.

If the URL does not specify a timeout, ColdFusion uses the lesser of the Administrator timeout and the timeout attribute value.

If the timeout is not set in any of these, ColdFusion waits indefinitely for the cfhttp request to process."

http://livedocs.adobe.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentation&file=part_cfm.htm

0
 
LVL 39

Expert Comment

by:gdemaria
ID: 18799988

 the timeout parameter is not a boolean, it should be the number of seconds for the timeout.   If not specified, it defaults to the setting your CF administrator.

 I suggest setting your  timeout to something big enough and trying again.

 timeout="600"    ... unit is in seconds

 I don't believe there is anyway to continue from your last session
0
 

Author Comment

by:liewsin
ID: 18800857
it's not working and get the same error message. it'll still stopped after the sec set in cf-admin.

the code:
-------------------------------------------
<cfif NOT FileExists(DIRECTORY_XMLData & FILENAME_thisXML)>
      <cfhttp
            method="Get"
            URL="http://www.templatemonster.com/webapi/template_updates.php?from=#DATETIME_update_from#&to=#DATETIME_update_to#"
            file="#FILENAME_thisXML#"
            path="#DIRECTORY_XMLData#" timeout="600" />
</cfif>


cf debugging message:
-------------------------------------------
TOTAL TIME: 120031 ms (same as setting in cf_admin, 120 sec)
STARTUP, PARSING, COMPILING, LOADING, & SHUTDOWN: 79 ms


URL parameters:
-------------------------------------------
download.cfm?requestTime=600&day=3


server setting
-------------------------------------------
Timeout Requests after ( 120 ) in seconds under cf_admin/Server Settings > Settings. And, this option is Checked.

0
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 

Author Comment

by:liewsin
ID: 18808713
and, cause this cf_template's hosted on a shared-hosting server. so, the server's setting for Request Timeout will still be uses, unless they've it un-checked.
0
 
LVL 39

Expert Comment

by:gdemaria
ID: 18808871

this statement seems odd to me:
ColdFusion uses the lesser of the Administrator timeout and the timeout attribute value.

You would think that the attribute would OVERRIDE the admin's setting.  That would make a lot more sense.

If that statement is true, you're best bet is to hope the administrator does not have it set.  Try removing the timeout attribute on the tag and see if that helps.  

Otherwise, according to that statement, you can't go beyond the admin settting !
0
 

Author Comment

by:liewsin
ID: 18812953
ok guys, found the answer. would like 2 share wif u.

"You may receive the error message “The request has exceeded
the allowable time limit” when executing an exceptionally long running template such as the code in Listing 5. To remedy this, you can use the “requesttimeout” attribute of the <CFSETTING>
tag to increase the timeout limit for the template and override the ColdFusion Administrator’s default timeout setting. Just insert the following code at the top of the template:
<CFSETTING REQUESTTIMEOUT = “360”
ENABLECFOUTPUTONLY = “no”>
This will reset the timeout limit for the template to six minutes
(i.e., 360 seconds) and preserve the ColdFusion Administrator’s
default timeout setting for all other templates on the server."


taken from CFDJ Mag.
0
 
LVL 39

Expert Comment

by:gdemaria
ID: 18813355

 ah, well done!
0
 
LVL 36

Expert Comment

by:SidFishes
ID: 24024725
Q: how can i RESUME the file(broken download previously), instead of re-download it again?

A:
you can't (resume dl)

You can mess with the timeout attribute to prevent the failure. (ie: "increase the timeout limit"


0

Featured Post

Use Filtering Commands to Process Files in Linux

Learn how to manipulate data with the help of various filtering commands such as `cat`, `fmt`, `pr`, and others in Linux.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi, Even though I have created this Tutorial on My personal Blog, Some people might not able to find my website, So here i am posting it again Today, from the topic it is very clear that i will be showing you here the very basic usage of how we …
Create a Windows 10 custom Image with custom task bar and custom start menu using XML for deployment.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question