Hi all,
I need to download an image from some URL to my server. However, my server's config disallowed me to do it this way:
getimagesize( $file );
Because, it generate error:
Warning: getimagesize() [function.getimagesize]: URL file-access is disabled in the server configuration in somefile.php on line 10
So, is there another way I can use that doesn't require external library?
Ok, I solved it with solution from OIS:
$filename = '/tmp/'.md5($file);
$ch = curl_init($file);
$fp = fopen($filename, "w");
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
fclose($fp);
$ext = getimagesize( $filename );