don’t get is the image showing in the browser

Pericles S. Nacionales nacional at CBS.UMN.EDU
Sun Apr 17 13:49:29 EDT 2005


The answer has to do with protocols.  When MapServer processes your mapfile, 
it works locally--your SHAPEPATH, IMAGEPATH, etc., all point to local paths 
within your OS. However, when MapServer finishes processing the mapfile, the 
rest of the work is handled by the HTTP protocol.  So everything has to be 
referenced via HTTP URLs--that's where the IMAGEURL comes in.

Let's say you have MapServer output images in e:\var\www\html\tmp\ (both Unix 
and DOS slashes are valid in MapServer except those pointing to URL's).  
Also, you have your web server (Apache or IIS) point to this directory as 
"/tmp/".  "/tmp/" is called an Alias by Apache or a virtual directory by IIS 
and is referenced relative to the web root URL (say, http://localhost/").  
So, in this case "/tmp/" is really pointing to "http://localhost/tmp/".
In MapServer, the parameter IMAGEURL references the IMAGEPATH directory but in 
HTTP URL terms.  In this case you'll define the paths:
IMAGEPATH "e:/var/www/html/tmp/"
IMAGEURL   "/tmp/"

I hope that clear things up.

-Perry


PS: Not to confuse you or anything but you can probably define non-HTTP urls 
(as in you original mapfile) but you have to append "file://"  instead of 
"http://" when referencing the imageurl. )  Things that make you go, hmm...

On Sunday 17 April 2005 10:01 am, Jack Gibb wrote:
> First part of map file
>
>
>
> MAP
   <snip>
>     WEB
>
>         IMAGEPATH "e:/var/www/html/tmp/"
>
>         IMAGEURL "e:/var/www/html/tmp/"
>
>     END
>
> ………………………
> ….
>
> When I run the PHP file I get the following line back.
> e:/var/www/html/tmp/111374926537881.png
>
> I get a small box at the top left with the same link location
>
> I get an image with the correct name in the correct location
>
> What I don’t get is the image showing in the browser. (even though it’s
> there and linked to it)
>
> What am I missing?
>
> Running Windows XP Pro with IIS5, latest version of MS4W

-- 
Pericles S. Nacionales

Dept. of Ecology, Evolution, and Behavior
University of Minnesota
work: 612 624 6713
e-mail: nacional at cbs.umn.edu



More information about the mapserver-users mailing list