CurlAxel - PHP file download accelerator

Status
Not open for further replies.
hi,

i try run test.php which have not edited yet exclude activeLog()
PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <script src="js/jquery.js"></script>
        <script src="js/jquery.progressbar.min.js"></script>
    </head>
    <body>
<?php
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
include 'CurlAxel.php';
//$fileurl = "http://cachefly.cachefly.net/100mb.test";
//$fileurl = "http://93.190.137.8/1000mb.bin";
$fileurl = "http://www.anggaran.depkeu.go.id/peraturan/Perdirjen_Anggaran03_2011%20-%20JuklaksunlahSBK2012.pdf";

echo "downloading $fileurl <br>";
$curlaxel = new CurlAxel;
$curlaxel->setUrl($fileurl);  
$curlaxel->activeLog(); 
$curlaxel->setProgressCallback(); 
$curlaxel->setBufferSize(32*1024*1024);
$curlaxel->activeLog(true); 
$curlaxel->download();
Code:
 downloading http://www.anggaran.depkeu.go.id/peraturan/Perdirjen_Anggaran03_2011%20-%20JuklaksunlahSBK2012.pdf 

[B]Warning[/B]:  Missing argument 1 for CurlAxel::activeLog(), called in C:\xampp\htdocs\curl\test.php on line 19 and defined in [B]C:\xampp\htdocs\curl\CurlAxel.php[/B] on line [B]133[/B]

[B]Notice[/B]:  Undefined variable: is in [B]C:\xampp\htdocs\curl\CurlAxel.php[/B] on line [B]134[/B]

[B]Warning[/B]:  Missing argument 1 for CurlAxel::setProgressCallback(), called in C:\xampp\htdocs\curl\test.php on line 20 and defined in [B]C:\xampp\htdocs\curl\CurlAxel.php[/B] on line [B]214[/B]

[B]Notice[/B]:  Undefined variable: is in [B]C:\xampp\htdocs\curl\CurlAxel.php[/B] on line [B]215[/B]
even file is success downloaded, but i got error warning like above.
and the most important , i dont see progress bar from jquery.
i also change to $curlaxel->setProgressCallback(true); but it still not work.


this is the log.txt
Code:
* About to connect() to www.anggaran.depkeu.go.id port 80 (#0)
*   Trying 202.137.230.82... * connected
* Connected to www.anggaran.depkeu.go.id (202.137.230.82) port 80 (#0)
> GET /peraturan/Perdirjen_Anggaran03_2011%20-%20JuklaksunlahSBK2012.pdf HTTP/1.1
Host: www.anggaran.depkeu.go.id
Accept: */*

< HTTP/1.1 200 OK
< Content-Length: 292896
< Content-Type: application/pdf
< Last-Modified: Wed, 01 Jun 2011 19:39:29 GMT
< Accept-Ranges: bytes
< ETag: "2843879f9320cc1:587"
< Server: Microsoft-IIS/6.0
< X-Powered-By: ASP.NET
< Date: Thu, 08 Dec 2011 16:01:38 GMT
< 
* Connection #0 to host www.anggaran.depkeu.go.id left intact
* Closing connection #0
something wrong? :facepalm:

anyway ,thanx, i like this apps <3 <3
 
Last edited:
sorry i forgot to update test.php
i've just pushed the changes, tested it again and works perfect. try it now.
d0Uw0.png
 
sorry i forgot to update test.php
i've just pushed the changes, tested it again and works perfect. try it now.
d0Uw0.png

nice job guys.
really amazing php class

but, i dont know why progress bar not work normally

1st tried: finish 80%
2nd tried: finish 40%
3th tried: finish 42%
4th tried: finish 100%
5th tried: finish 20%

this happen both on less than 5mb and 5mb++ (slow_download and fast_download)

i modified your script like this to know the basic of progress bar
http://www.mediafire.com/?sb23aqhspsa1hv9

these are the result of slow_download(), fast_download() and my script
curlaxel.JPG


so, the problem is, progress bar didn't work fine, although the file is 100% downloaded.

i so confused about this, because if i look for the source in my browser (firefox) the progressBar() is called from 1 until 100, but the progressbar still shown on 63%. have i did something wrong? :(


and the second,
i dont know why my browser is like hang up before progress bar has shown up.

sorry 4 my english.
i hope u can understand what i meant. :facepalm:

anyway, i like your class <3 <3
 
solved :)

change $progress
into
PHP:
            $progress = create_function('$download_size, $downloaded, $upload_size, $uploaded','static $sprog = 0;
            @$prog = ceil($downloaded*100/$download_size);
                echo \'<script>$("#'.$pb.'").progressBar(\'. $prog. \');</script>\';
            ');
correct the progress bar and its work on multiple file download.
download first file >> wait until finish (progress bar show) >> finish >>
download second file >> wait until finish (progress bar show) >> finish >> .....
curlaxel5.JPG


is very nice see the basic of your work , awesome class :)

now, i ask u permission to use this class for my apps. may i have this?

cehhms@yahoo.com
 
Last edited:
Please i have a problem

Notice: Use of undefined constant CURLOPT_PROGRESSFUNCTION - assumed 'CURLOPT_PROGRESSFUNCTION' in /**************/CurlAxel.php on line 352

Notice: Use of undefined constant CURLOPT_PROGRESSFUNCTION - assumed 'CURLOPT_PROGRESSFUNCTION' in /**************/CurlAxel.php on line 352

Notice: Use of undefined constant CURLOPT_PROGRESSFUNCTION - assumed 'CURLOPT_PROGRESSFUNCTION' in /**************/CurlAxel.php on line 352

Notice: Use of undefined constant CURLOPT_PROGRESSFUNCTION - assumed 'CURLOPT_PROGRESSFUNCTION' in /**************/CurlAxel.php on line 352

Notice: Use of undefined constant CURLOPT_PROGRESSFUNCTION - assumed 'CURLOPT_PROGRESSFUNCTION' in /**************/CurlAxel.php on line 352
 
share4free, please show me the version of CurlAxel you are using
darkslayer, put a pull request in github, you have the absolute right to use it in your app :)
 
solved :)

change $progress
into
PHP:
            $progress = create_function('$download_size, $downloaded, $upload_size, $uploaded','static $sprog = 0;
            @$prog = ceil($downloaded*100/$download_size);
                echo \'<script>$("#'.$pb.'").progressBar(\'. $prog. \');</script>\';
            ');
correct the progress bar and its work on multiple file download.
download first file >> wait until finish (progress bar show) >> finish >>
download second file >> wait until finish (progress bar show) >> finish >> .....
curlaxel5.JPG


is very nice see the basic of your work , awesome class :)

now, i ask u permission to use this class for my apps. may i have this?

cehhms@yahoo.com

without the time condition the data transmitted for the progress bar will be huge and will slow down download speed.
 
without the time condition the data transmitted for the progress bar will be huge and will slow down download speed.
can u explain why i must use time condition in it?

at first i just need how to implemented progress bar download with curl.
now, i try to concern to get more speed like curlaxel did.


thx 4 your replay.


github: i can place this apps in github cz this is an ilegal apps :D
just brute link to download 15++ epaper (paid or free) and combine it automatically. so sorry if i cant show u my full code, but i still write your name in my source code :)
 
can u explain why i must use time condition in it?
because without that condition, after every buffer of data downloaded, CurlAxel will send new progress info, which would be really traffic consuming => speed consuming.
we need the progress bar to be refreshed every x seconds, not every x data downloaded.
 
Status
Not open for further replies.
Back
Top