There is a link that starts downloading the file - http://zakupki.gov.ru/223/purchase/public/download/download.html?id=3324768 . The question is how to upload a file to your server by clicking on this link?
|
2 answers
The easiest way is through cURL :
$fp = fopen('uploads/download.pdf', 'wb'); // Открываем файл $ch = curl_init("http://zakupki.gov.ru/223/purchase/public/download/download.html?id=3324768"); curl_setopt($ch, CURLOPT_FILE, $fp); // Передаём дескриптор файла, туда сбросится результат curl_setopt($ch, CURLOPT_HEADER, 0); curl_exec($ch); curl_close($ch); fclose($fp); |
You can use the file_get_contents function
- Then
file_put_contents('file.pdf', file_get_contents($path));. - user31688
|