php - Image exists on remote URL but curl give me 404 status -


i have wordpress site facing issues using images.

the images exist on server, when access images via url, works , image shows.

but when use curl, file_get_contents, fopen, copy etc command or access file, 404 error status code.

can can me, don't know if it's server issue or wordpress issue.

below sample of code:

$url = "http://blogbucket.in/wp-content/uploads/files/0b6igyyw9a5rys0tneljrdmfsmtq/airbitz-co1.png"; $ch = @curl_init($url); @curl_setopt($ch, curlopt_header, true); @curl_setopt($ch, curlopt_nobody, true); @curl_setopt($ch, curlopt_followlocation, true); @curl_setopt($ch, curlopt_failonerror, true); @curl_setopt($ch, curlopt_returntransfer, true); @curl_setopt($ch,curlopt_useragent,'mozilla/5.0 (windows; u; windows nt 5.1; en-us; rv:1.8.1.13) gecko/20080311 firefox/2.0.0.13');  @curl_exec($ch); $header = curl_getinfo($ch); curl_close($ch); echo "<pre>"; print_r($header); echo "<pre>"; 

below links i've looked @ far.

you can try here.

the images exist on server, when access images via url, works , image shows.

but when use curl, file_get_contents, fopen, copy etc command or access file, 404 error status code.

this url returns 404 response image payload. can disregard response code , use image data response body.


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -