Solved

resume failed download, CFHTTP

Posted on 2007-03-27
10
944 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 250 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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

752 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