![]() Topic awaiting preservation: php, getimagesize(http//...) with allow_url_fopen OFF (Page 1 of 1) |
|
---|---|
Paranoid (IV) Mad Scientist From: Omicron Persei 8 |
![]() hi, i was wondering if there is a possibility to do a php->getimagesize of an image on another machine, but with the allow_url_fopen set to OFF. (Dreamhost configuration) |
Paranoid (IV) Mad Scientist From: Omicron Persei 8 |
![]() ok, i just found a solution myself: code: $ch = curl_init("http://www.someadress/img.gif"); $filename="/somewriteablepath/test/yxc"; $fp = fopen($filename, "w"); curl_setopt($ch, CURLOPT_FILE, $fp); curl_setopt($ch, CURLOPT_HEADER, 0); curl_exec($ch); curl_close($ch); fclose($fp); print_r(getimagesize($filename)); |
Paranoid (IV) Mad Scientist with Finglongers From: Germany |
![]() now... what happens if that script runs multiple times at the same time? |
Paranoid (IV) Mad Scientist From: Omicron Persei 8 |
![]() |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
![]() yeah if you get separate requests. |
Paranoid (IV) Mad Scientist with Finglongers From: Germany |
![]() No! |
Paranoid (IV) Mad Scientist From: Omicron Persei 8 |
![]() how do i get the file path of the php->tmpfile ? cause php->getimagesize only takes file paths and not file handles. |