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

  • Home
  • SEARCH
  • 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 9200833
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:51:20+00:00 2026-06-17T22:51:20+00:00

I am wanting to use this example: https://stackoverflow.com/a/5830599 Pretty much for the very reason

  • 0

I am wanting to use this example:

https://stackoverflow.com/a/5830599

Pretty much for the very reason mentioned on this page.

I’m trying to serve up larger files (100-200megs in general) and need to ‘output’ the data in chunks instead of it reading it all in memory with curl_exec(). My web host provider only allows me 64 megs of memory so I can’t read that much information at once.

Any suggestions here? Thanks in advance.

  • 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-17T22:51:21+00:00Added an answer on June 17, 2026 at 10:51 pm

    This is pretty easy. All you need to do is provide cURL with a callback to handle data as it comes in.

    function onResponseBodyData($ch, $data)
    {
        echo $data;
        return strlen($data);
    }
    
    curl_setopt($ch, CURLOPT_WRITEFUNCTION, 'onResponseBodyData');
    

    Returning the length of data from your callback is important. It signifies how much data you processed. If you return something other than the length of data passed in (such as 0), then the request is aborted.

    Now, make sure you don’t have output buffering turned on, and configure your server to not buffer the entire response before sending. It will work out of the box on most configurations.

    You can find more examples here: http://curl.haxx.se/libcurl/php/examples/callbacks.html

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

Sidebar

Related Questions

I am wanting to rewrite a url like: http://my.project/mydomain.com/ANY_NUMBER_OF_CATEGORIES/designer/4/designer-name/page.html to this: http://my.projects/mydomain.com/ANY_NUMBER_OF_CATEGORIES/page.html?designer=4 I would
i am trying to parse this xml file into an object to use the
I'm wanting to use a plugin know as dropdown-check-list: http://code.google.com/p/dropdown-check-list/ However, some of its
I'm wanting to implement what CommonsWare describes on this blog post: http://commonsware.com/blog/2010/08/11/activity-notification-ordered-broadcast.html . The
I'm wanting to use a php variable as the destination email for Amazon SES
I'm wanting to use two Objective-C libraries in a MonoTouch app: the Facebook library
I am wanting to use jquery to do a show/hide of a DIV from
I'm wanting to use the jquery dialog to open a modal dialog, and in
When dealing with a series of numbers, and wanting to use hash results for
Stuck on KVCs in Obj-C again. I am wanting to use KVC to find

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.