Re: Generating images on the fly, linking via symlink?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dan Trainor wrote:
Dan Trainor wrote:

Hello, all -

This is a question that could depend on a completely different (yet, relayed) subject, so I'm sending this email to both php-general@ and httpd@xxxxxxxxxxxxxxxxx I thank you in advance for your understanding.

I am currently generating some images on the fly using some of PHP's image generation and rendering functions. I'm having loads of success, and like the results that I see.

What I'd like this script to do is, to create symlinks to the origional image, and then when the script is done running, the symlinks are deleted. Basically trying to make it so that the origional image is not known to the client or browser.

So I'm taking, say, image1.jpg.  I'm creating a symlink via:

$linkname = md5(rand());

or something similar. I'd then like to return $linkname to the client or browser. Then, when the browser has completed rendering the page to the client or browser, the symlink is then deleted.

What I'm curious as to right now is if I do this, the client will see the link to $linkname via HTML's "img src=" specification. What happens if this is sent to the client or browser, and the symlink is deleted immediately after the name is sent to the client or browser? Would the web server (in this case, Apache) cache the image in memory until the client has downloaded said image, and then delete it from memory when the page is done rendering or being sent? Will PHP totally disregard the web server's request to "hold" the image, and render nothing to the browser? This is something I'm confused about.

Thanks!
-dant


Hello -

Don't suppose anyone has any pointers for me with this one, do ya?

Thanks!
-dant


I tried something similar to this a while back, although not with symlinks. I was writing a copy of the image to a "temporary" directory, sending that out to the browser in an <img> tag, then removing the copy. It worked like a charm in IE, but Netscaape/Mozilla/Firebird/Safari would give me a "corrupted image" or some-such error.

The only thing I could figure out from it was the browsers that do a "look ahead" on the links to the image wouldn't see an image at the link before it was clicked, and would cache that result. Eventually I just gave up on that idea.

You might look for the recent threads that deal with dynamic image generation that sends the image directly to the browser. There's been a few reciently and you might be able to do something with that.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux