Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- As of php 5.3 CURLOPT_PROGRESSFUNCTION its supported here's how:
- <?php
- function callback($download_size, $downloaded, $upload_size, $uploaded)
- {
- // do your progress stuff here
- }
- $ch = curl_init('http://www.example.com');
- // This is required to curl give us some progress
- // if this is not set to false the progress function never
- // gets called
- curl_setopt($ch, CURLOPT_NOPROGRESS, false);
- // Set up the callback
- curl_setopt($ch, CURLOPT_PROGRESSFUNCTION, 'callback');
- // Big buffer less progress info/callbacks
- // Small buffer more progress info/callbacks
- curl_setopt($ch, CURLOPT_BUFFERSIZE, 128);
- $data = curl_exec($ch);
- ?>
- Hope this help.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement