By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,341 Members | 1,693 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,341 IT Pros & Developers. It's quick & easy.

Sending an image to a browser

P: n/a
I have an image that resides in a directory that isn't accessible on the
web, however I want to be able to send that image via PHP without making
it directly accessible on the web. The URL would be something like this
... image/username/image-name.

The reason I want to do this is so that I can do authentication on the
user before having it pushed to the browser. How would I be able to do this?
Jul 27 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On 27 Jul, 11:43, Vernon Wenberg III <vwenb...@gmail.comwrote:
I have an image that resides in a directory that isn't accessible on the
web, however I want to be able to send that image via PHP without making
it directly accessible on the web. The URL would be something like this
.. image/username/image-name.

The reason I want to do this is so that I can do authentication on the
user before having it pushed to the browser. How would I be able to do this?
http://uk.php.net/manual/en/function.readfile.php

Jul 27 '07 #2

P: n/a
Rik
On Fri, 27 Jul 2007 12:50:08 +0200, Captain Paralytic
<pa**********@yahoo.comwrote:
On 27 Jul, 11:43, Vernon Wenberg III <vwenb...@gmail.comwrote:
>I have an image that resides in a directory that isn't accessible on the
web, however I want to be able to send that image via PHP without making
it directly accessible on the web. The URL would be something like this
.. image/username/image-name.

The reason I want to do this is so that I can do authentication on the
user before having it pushed to the browser. How would I be able to do
this?

http://uk.php.net/manual/en/function.readfile.php
And don;t forget to send the right mime-type headers.

(BTW, I assume you allready have a script that determines wether a user is
logged in or not?)

--
Rik Wasmus
Jul 27 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.