Posted by Alvaro G. Vicario on 11/19/05 00:59
*** R Padala escribió/wrote (18 Nov 2005 07:23:48 -0800):
> What is the best way to serve the images so that the user wouldn't get
> hold of other images on the webserver?
Keep them in a folder out of the public folder tree and write a download
script to serve them.
If your web is under /home/foo/htdocs you can create /home/foo/pictures and
then write a script that:
1) Check credentials
2) Find picture's file name
3) Send appropriate "Content-Type" header
4) Read file and output it to browser
Some helpful functions:
mime_content_type()
getimagesize()
header()
readfile()
--
-+ Álvaro G. Vicario - Burgos, Spain
++ http://bits.demogracia.com es mi sitio para programadores web
+- http://www.demogracia.com es mi web de humor libre de cloro
--
[Back to original message]
|