php - Url Download to Server 500 Error after long time -


i'm using fopen , fwrite download url files (zip,rar etc) direct server, if file large or takes long time download returns 500 error.

php

$destination_folder = 'files/';  $url = $_post['url']; $newfname = $destination_folder . basename($url);  $file = fopen ($url, "rb"); if ($file) {   $newf = fopen ($newfname, "wb");    if ($newf)   while(!feof($file)) {     fwrite($newf, fread($file, 1024 * 8 ), 1024 * 8 );   } }  if ($file) {   fclose($file); }  if ($newf) {   fclose($newf); } 


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -