Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8355405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T09:51:08+00:00 2026-06-09T09:51:08+00:00

I am using cfhttp to get documents and parse the content like so: <cfhttp

  • 0

I am using cfhttp to get documents and parse the content like so:

<cfhttp
        method="GET"
        url="#url.strURL#"
        resolveurl="true"
        useragent="#CGI.http_user_agent#"
        result="objGet"
        timeout="60"
        charset="utf-8"
    />

However, some of the documents are rather large. I do not need to get the entire thing – which could take a long time.

Is there any way in which I can stop running cfhttp after X number of bytes loaded? Or set a limit on how much to get for example.

Appreciate the help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T09:51:09+00:00Added an answer on June 9, 2026 at 9:51 am

    If the target server supports it, you can use the Range http header:

    <cfhttp
            method="GET"
            url="#url.strURL#"
            resolveurl="true"
            useragent="#CGI.http_user_agent#"
            result="objGet"
            timeout="60"
            charset="utf-8"/>
       <cfhttpparam type="header" name="Range" value="bytes=0-499" />
     </cfhttp>
    

    Apache and IIS supports this, so for static content you’ll probably be in luck. Dynamic content would be trickier…

    …I’ve just tried this with a CFM being served through Apache, and it looks like that didn’t work. I suspect that if Apache/IIS is serving a static file, then it can safely send back a range of bytes from the document you’re requesting because it can read the file. If the request is for something being generated by CF/ASP/JSP/whatever, then it’d be up to the Appliation to honour the Range: header in the request. In my case, I still got the whole document because my Application doesn’t look at the Range header.

    I should also mention that it’s possible to do what you’re after in Java, as you’ve got finer-level control of what’s going on, but you’d have to write something yourself or use one of the alternative HTTP Client Libraries out there. It depends how important the feature is to you I suppose. If the documents are seriously large then you may need to use the file attribute of cfhttp to avoid getting the whole response into memory, which could cause crashes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using cfhttp to post data to a URL and getting connection failure as
using file_get_contents , I open an Internet URL and get the contents of this
Using the current request I can get the URL hostname with: HttpContext.Current.Request.Url.Host But -
Using SQL Alchemy, I'd like to know if it's possible to get a list
Using the Redis info command, I am able to get all the stats of
Using Location.getBearing(); I seem to get randomly changing bearings. Aka, I can turn the
Using Rails 3.2.0 with haml and sass: I Would like to link an external
i'm trying to get CFHTTP to talk to a domain that i have created
I have a page which tries to get the value from another server using
Using WebViewBrush I can render web page content (it's screen shot) to e.g. Rectangle

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.