From 904799f591493ab1cb97765b82b45fe91686a3c3 Mon Sep 17 00:00:00 2001 From: denis Date: Mon, 25 May 2026 13:59:17 +0000 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20receiving=5Fbig=5Ffile.php?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- receiving_big_file.php | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/receiving_big_file.php b/receiving_big_file.php index f142676..5e12b33 100644 --- a/receiving_big_file.php +++ b/receiving_big_file.php @@ -3,4 +3,40 @@ /* * Получение больших файлов имитирую браузер * -/* \ No newline at end of file +* @param string $url - Путь к файлу +* @param string $name- Название скаеваемого файла +* +*/ + + function downloadBig($url,$name_file):string{ + + $proxy = '10.13.122.242:8090'; + + if(!file_exists('tmp')) mkdir('tmp'); + + $fp = fopen ('tmp/' . basename($name_file['path']), 'w+'); + $ch = curl_init($url); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_POST, 1); + curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($name_file, '', '&')); + curl_setopt($ch, CURLOPT_PROXY, $proxy); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($ch, CURLOPT_HEADER, false); + curl_setopt($ch, CURLOPT_FILE, $fp); + $file = curl_exec($ch); + $info = curl_getinfo($ch); + curl_close($ch); + fclose($fp); + + if($info['http_code'] == 200){ + + if($file){ + return "tmp/".basename($name_file['path']); + } + + }else{ + setLog("Error","Ошибка получения от ВП",$info); + } + + return false; + } \ No newline at end of file