Hallo zusammen,
ich habe folgendes Problem:
Mittel "curl" würde ich gerne prüfen, ob eine Datei existiert. In meinem Fall, handelt es sich um eine Word-Datei (.doc), welche er "downloaden" würde, aber im Header 404 ausgibt?
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);
curl_setopt($ch, CURLOPT_TIMEOUT, 50);
curl_setopt($ch, CURLOPT_NOBODY, true);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response =curl_exec($ch);
$curl_info = curl_getinfo($ch,CURLINFO_HTTP_CODE);
curl_close($ch);
Vielen lieben Dank im Voraus.