|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
I'm using curl to scrape an image file from an external server (see
code below). Is there any way to determine the external image file's modified date? Ideally, I'd like to only process the image if it's new. $source = "http://www.example.com/image.jpg"; $ch = curl_init ($source); $fp = fopen ($fileOriginal, "w"); curl_setopt ($ch, CURLOPT_FILE, $fp); curl_setopt ($ch, CURLOPT_HEADER, 0); curl_exec ($ch); curl_close ($ch); fclose ($fp); |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
On Jun 23, 2:37 am, Sav <savar...@gmail.com> wrote:
> I'm using curl to scrape an image file from an external server (see > code below). Is there any way to determine the external image file's > modified date? Ideally, I'd like to only process the image if it's > new. > > $source = "http://www.example.com/image.jpg"; > $ch = curl_init ($source); > $fp = fopen ($fileOriginal, "w"); > curl_setopt ($ch, CURLOPT_FILE, $fp); > curl_setopt ($ch, CURLOPT_HEADER, 0); > curl_exec ($ch); > curl_close ($ch); > fclose ($fp); It may there in the headers. But its not a required header. Why not just apply the caching rules which came with the image? C. |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
On Jun 23, 5:37 am, "C. (http://symcbean.blogspot.com/)"
<colin.mckin...@gmail.com> wrote: > Why not just apply the caching rules which came with the image? How do I do that? |
|
![]() |
| Outils de la discussion | |
|
|