PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.php > Possible to get modified date of external image with curl?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Possible to get modified date of external image with curl?

Réponse
 
LinkBack Outils de la discussion
Vieux 23/06/2008, 02h37   #1
Sav
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Possible to get modified date of external image with curl?

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);
  Réponse avec citation
Vieux 23/06/2008, 13h37   #2
C. (http://symcbean.blogspot.com/)
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Possible to get modified date of external image with curl?

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.
  Réponse avec citation
Vieux 23/06/2008, 21h35   #3
Sav
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Possible to get modified date of external image with curl?

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?
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 02h07.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,09314 seconds with 11 queries