[mapserver-users] not unique image filenames problem

E Perik erwin at perik.nu
Thu Mar 28 15:21:53 EST 2002


Daniel,

Could the same solution (PHP as a CGI) be right for the 'problem' I
have:

>From the mainpage I passes variables to a new PHP page (popup) using
javascript. This PHP page draw's a new map based on the passed
query-variables.

All is well for about 90% of the queries, but the other times it does
not 
show the newly created image but it shows the "red-X".

Think in my case mapserver is slower in generating the image then PHP is
in generating the code which loads the image.

Preloading the image only works when the image is already created, but
that's no possibility.

Hope it is,

Erwin


-----Original Message-----
From: owner-mapserver-users at lists.gis.umn.edu
[mailto:owner-mapserver-users at lists.gis.umn.edu] On Behalf Of Daniel
Morissette
Sent: Thursday, March 28, 2002 3:13 PM
To: schut at GisSrv.IenD.wau.nl
Cc: mapserver-users at lists.gis.umn.edu
Subject: Re: [mapserver-users] not unique image filenames problem

Vincent, and all,

This must be happening on a server running PHP as an Apache module,
correct?  You shouldn't experience this problem if you setup your PHP as
a CGI instead of as a module.

See http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?PHPMapScriptCGI

Daniel



Vincent Schut wrote:
> 
> Regarding my previous mail,
> 
> I "solved" the problem :-)
> I now use a workaround using the php tempnam function, combining this
with a
> timestamp, and using this with mapscript saveImage in stead of
saveWebImage.
> Now I think I have quite unique filenames... :-)
> 
> Maybe a suggestion to future versions of mapserver/script to use a
similar
> way to create their web filenames?
> 
> Thanks for the reactions, they helped to get me on the right track.
> 
> Vincent.
> 
> On Thursday 28 March 2002 11:19, Vincent Schut wrote:
> > Hi folks,
> >
> > I'm running into a strange problem. Propably I'm doing something
wrong :-)
> >
> > I'm using php/mapscript to create (quite simple) raster images and
view
> > them in a web page where you can zoom in/out and pan etc.
> > Everything works well, except that sometimes not the desired image
of the
> > next zoom (or pan) operation appears, but an image that was created
some
> > steps ago. I found out that this happens because the
$map->saveWebImage
> > does *not* always create a new, unique name for the image to be
saved in
> > the temp directory. If an image with the same name already exists,
the save
> > apparently doesn't succeed and the old image is loaded.
> >
> > Something wrong with the way mapserver creates "unique" image file
names?
> > How to solve this? Anybody had the same experience?
> >
> > Curiously,
> >
> > Vincent Schut.




More information about the mapserver-users mailing list