On Tue, 2004-11-02 at 16:45 -0600, P. George wrote: > i am storing images in a postgres database and i have set up a little > php file to retrieve them in such a way that i can do: > > echo "<img src='gif.php?name=$picname'>"; > > ...from another php file. > > it's working great, BUT i've noticed two things that bother me: > > [1] if someone wants to download an image, they can, but it will be > downloaded as "gif.php" instead of "whatever.gif". even though > renaming the file solves the problem, users will be confused by this. > > [2] (and i think this may be related to the first problem) is that in > at least one of my browsers (camino/osx) the images are ALWAYS pulled > directly from the server. they are never cached by the browser. i > suppose all browsers may be behaving this way, but in camino, it is > blatantly and visually obvious as you watch the gif being slowly > downloaded/displayed over a slow connection. > > anyone know what to do for either of these? concerning [2], i'm > thinking maybe i can implant the local browser cache _manually_ instead > of depending on the browser to do it for me? if so, how would i go > about doing that? > > thanks. > > - philip > My guess is that your browser isn't set to cache .php file output. If it's caching images, you might need to trick it into thinking that it's an image. for example, look at the mod_rewrite rules at the bottom of this blog post. http://blog.planetargon.com/index.php?/archives/27_Displaying_image_from_PostgreSQL_large_object_with_PHP.html I don't know if this *is* the issue, but it's my first guess. -Robby -- /*************************************** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | robby@xxxxxxxxxxxxxxx * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting & Development * --- Now supporting PHP5 --- ****************************************/
Attachment:
signature.asc
Description: This is a digitally signed message part