[PHP] Showing an image outside of the web folder

2006-05-05 Thread James Nunnerley
I'm creating a file manager application, from which I want the user to be
able to edit/view files.

On the text side of things, it's pretty easy, however from the image side of
things, I'm not sure how to allow the user to view files outside of the web
folder.

Doing a readfile ($file_location) outputs the binary... can someone point
me in the direction of being able to translate that binary into a viewable
image file?

Cheers
Nunners

 



Re: [PHP] Showing an image outside of the web folder

2006-05-05 Thread John Nichel

James Nunnerley wrote:

I'm creating a file manager application, from which I want the user to be
able to edit/view files.

On the text side of things, it's pretty easy, however from the image side of
things, I'm not sure how to allow the user to view files outside of the web
folder.

Doing a readfile ($file_location) outputs the binary... can someone point
me in the direction of being able to translate that binary into a viewable
image file?

Cheers
Nunners



PHP Manual - Function Reference - Image Functions

Google - php display image

IMO
It's easier to say RTFM and/or STFW
/IMO

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] Showing an image outside of the web folder

2006-05-05 Thread Rabin Vincent

On 5/5/06, James Nunnerley [EMAIL PROTECTED] wrote:

Doing a readfile ($file_location) outputs the binary... can someone point
me in the direction of being able to translate that binary into a viewable
image file?


Drop the appropriate content-type header:

header('Content-type: image/png');
readfile('/home/foo/bar.png');

Rabin

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



[PHP] showing an image with php

2005-03-11 Thread Ross Hulford
I want to asssign an image to a variable and show it if certain conditions 
are met. E.g


If condition is met

{
$myimage= retrieve image (images/myimage.jpg)
 echo $myimage
}

Have not used image creation before with php just dipping my toe in the 
water.

Thanks


R. 

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



Re: [PHP] showing an image with php

2005-03-11 Thread Richard Lynch

 I want to asssign an image to a variable and show it if certain conditions
 are met. E.g


 If condition is met

 {
 $myimage= retrieve image (images/myimage.jpg)
  echo $myimage
 }

 Have not used image creation before with php just dipping my toe in the
 water.

Not sure you need to use image creation now.

All you seem to really want to do is display an IMG tag, or not, based on
the if.

if (...){
  echo img src=images/myimage.jpg;
}

-- 
Like Music?
http://l-i-e.com/artists.htm

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



[PHP] Showing an Image

2001-07-02 Thread kachaloo

HI,
I want to show an image from a database but to do that I am using :
 $result = @mysql_query($sql);
 $data = @mysql_result($result, 0, PICTURE);
 $type = @mysql_result($result, 0, FILETYPE);
 Header(Content-type: $type);
 echo $data;


but after this I also want to show some text info. How can I do this ? I
will have to use something else besides header. Please Help.
Thanks,
Vishal



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Showing an Image

2001-07-02 Thread mike cullerton

how about something like,

 $result = @mysql_query($sql);
 $data = @mysql_result($result, 0, PICTURE);
 $type = @mysql_result($result, 0, FILETYPE);
 $comment = @mysql_result($result, 0, COMMENT);
 Header(Content-type: $type);
 echo $data . br . $comment;

or, instead of using Header, create a page and inside it put
 printf(%sbr%s,$image,$comment)

mike

on 7/2/01 1:39 AM, kachaloo at [EMAIL PROTECTED] wrote:

 HI,
 I want to show an image from a database but to do that I am using :
 $result = @mysql_query($sql);
 $data = @mysql_result($result, 0, PICTURE);
 $type = @mysql_result($result, 0, FILETYPE);
 Header(Content-type: $type);
 echo $data;
 
 
 but after this I also want to show some text info. How can I do this ? I
 will have to use something else besides header. Please Help.
 Thanks,
 Vishal
 
 


-- mike cullerton   [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]