-
Notifications
You must be signed in to change notification settings - Fork 821
Description
version:8.6.1
When I use the download method to download a file, I get an error:
The URL address is wrong:
$curl = new Curl();
$curl->setTimeout(10);
$curl->setOpt(CURLOPT_SSL_VERIFYPEER, FALSE);
$curl->setOpt(CURLOPT_SSL_VERIFYHOST, FALSE);
$url = 'http://baiduxxxx.com/favicon.icoa';
$curl->download($url, './a.tmp');
PHP Fatal error: Uncaught Exception: unlink(./a.tmp.pccdownload): Resource temporarily unavailable in \public\bat\helper\common.php:7
Stack trace:
#0 [internal function]: throwErr(2, 'unlink(./a.tmp....', '\www...', 1568, Array)
#1 \library\php-curl\src\Curl\Curl.php(1568): unlink('./a.tmp.pccdown...')
#2 \library\php-curl\src\Curl\Curl.php(447): Curl\Curl->downloadComplete(Resource id #29)
#3 \library\php-curl\src\Curl\Curl.php(430): Curl\Curl->execDone()
#4 \library\php-curl\src\Curl\Curl.php(469): Curl\Curl->exec()
#5 \library\php-curl\src\Curl\Curl.php(329): Curl\Curl->get('http://baiduxxxx.com...')
#6 \public\bat\www\start.php(111): Curl\Curl->download('http://baiduxxxx.com...', './a.tmp')
Currently, my method is to handle it with try-catch,like:
$code = 9999;
$url = 'http://baidu.com/favicon.icoa';
try {
$curl->download($url, './a.tmp');
} catch (Exception $e) {
$code = $e->getCode();
echo 'download ',$url,' error.';
}
if ($code == 9999) echo md5_file('./a.tmp');
I don't know if this question is a bug.