Can't download a png map tile from google maps with php


If I try to download a map tile from the google servers with php, the ones that contain the satelite images download fine (the ones in jpeg).  But if I try to download the ones with the maps (in png), I get a "Forbidden 403" error.

If I include the url of the png image in a html img tag, the images shows up with no problem.
If I create the image with javascript the image comes up fine.
If I download the image with urldownloadtofile in delphi, the image downloads perfectly.
If I plug in the url in IE the image downloads fine.

I tried using two diferent hosts and get the same problem.

If I try with a different png image from another url the image downloads fine with the same php script.

Thank you.

  $mapImage = @imagecreatefrompng('');
  header("Content-type: image/png");

Open in new window

Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

lunadlConnect With a Mentor Commented:
I beleive this is a hotlinking issue with google prevenitng you from relisting it as your image from your server. It may be best if you just put the image in any of the other methods you mentuioned before. They don't want you to take the image and reprint it as yours, thats why all the other methods work and this one does not. Good Luck.
Is this being hosted third party or are you hosting it yourself?
jasgAuthor Commented:
Hello. I am using two comercial hosts: yahoo and caracasstream also I have tried on my pc, same behavior on all three.

Thank you.
Never miss a deadline with

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Hmm I get page not found with it right now. Where is the interface you using to get to these images?
jasgAuthor Commented:
Hello.  Sorry the "?" was missing in the first post:
CWS (haripriya)Commented:
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup topic area:
   Accept: lunadl {http:#20862390}

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

Experts Exchange Cleanup Volunteer
Forced accept.

EE Admin
All Courses

From novice to tech pro — start learning today.