Re: [PHP] Re: files outside of documentRoot

2011-10-14 Thread Ricardo Martinez
Mmm i'm trying to show a .flv but i dont know if i'm using the correct
headers and method.

$name = $file;
$fp = fopen($name, 'rb');

// send the right headers
header(Content-Type: video/x-flv);
header(Content-Length:  . filesize($name));

// dump the picture and stop the script
fpassthru($fp);
exit;

i'm getting all time the player black.

all idea are welcome!!! :)

thx!!!

On Wed, Oct 12, 2011 at 12:46 PM, Ricardo Martinez harisel...@gmail.comwrote:

 It works thx a lot =)



 On Tue, Oct 11, 2011 at 5:26 PM, Bastien Koert phps...@gmail.com wrote:

 On Tue, Oct 11, 2011 at 11:00 AM, Ricardo Martinez harisel...@gmail.com
 wrote:
  Hi!
 
  i'm was checking, readfile(); and fpassthru();
 
  With easy examples, i can use it for show a pic in the screen and
 download a
  file, from outside of documentRoot. It works fine.
 
  The problem that i have now, is, i need can work with it, inside of
 other
  documents, but i'm getting all time error by the headers. ( already
 sendt
  ... )
 
  Anyone knows how to use it for can call the files and work together with
  other page ¿?
 
  Thanks
 
  On Sun, Oct 9, 2011 at 6:57 PM, Sean Greenslade zootboys...@gmail.com
 wrote:
 
 
  On Sun, Oct 9, 2011 at 9:52 AM, Ricardo Martinez harisel...@gmail.com
 wrote:
 
  The files are, png, pdf and flv.
 
  Only users login can see or download it.
 
  thx ;
 
  On Sat, Oct 8, 2011 at 11:16 PM, Shawn McKenzie nos...@mckenzies.net
  wrote:
 
   On 10/08/2011 03:40 PM, Ricardo Martinez wrote:
Hi List!
   
I need to access files outside the DocumentRoot.
   
I've been looking for info and documentation, and I've read that
 it
  can
   be
done using symbolic links and another way is by using headers.
   
I want to know, what do you think, what is the best way, and if
 anyone
   knows
a good doc about of it.
   
Thanks!!!
   
  
   It depends on what you mean by files.  Are they PHP files that
 need to
   be run, or images, or files that need to be downloaded by the user?
  
   For PHP, you would add the external dir to your include path.
  
   For images you can use a php file as the img src and that file sets
 the
   appropriate headers and uses readfile() to get and echo the image
 data:
   getimage.php?image=someimage.gif
  
   For download files you would do it in the same manner as for images:
   download.php?file=somefile.zip
  
  
   --
   Thanks!
   -Shawn
   http://www.spidean.com
  
 
  --
  Ricardo
  ___
  IT Architect
  website: http://www.pulsarinara.com
 
 
 
  Sounds like the downloader php script would be perfect (what Shawn
  suggested). Have the script check the login status, then (if valid)
 send the
  proper headers for the file and read out the data with the script.
 
  --
  --Zootboy
 
  Sent from my PC.
 
 
 
 
  --
  Ricardo
  ___
  IT Architect
  website: http://www.pulsarinara.com
 

 For images and the like, I have a separate page that is called that
 handles the image and the headers needed

 In the page I have some thing like

 echo img src='get_image.php?id=$id';

 Then in the get-image.php page i have the code that gets the image
 from the db, outputs the appropriate headers and then outputs the
 image

 --

 Bastien

 Cat, the other other white meat




 --
 Ricardo
 ___
 IT Architect
 website: http://www.pulsarinara.com




-- 
Ricardo
___
IT Architect
website: http://www.pulsarinara.com


Re: [PHP] Re: files outside of documentRoot

2011-10-12 Thread Ricardo Martinez
It works thx a lot =)



On Tue, Oct 11, 2011 at 5:26 PM, Bastien Koert phps...@gmail.com wrote:

 On Tue, Oct 11, 2011 at 11:00 AM, Ricardo Martinez harisel...@gmail.com
 wrote:
  Hi!
 
  i'm was checking, readfile(); and fpassthru();
 
  With easy examples, i can use it for show a pic in the screen and
 download a
  file, from outside of documentRoot. It works fine.
 
  The problem that i have now, is, i need can work with it, inside of other
  documents, but i'm getting all time error by the headers. ( already sendt
  ... )
 
  Anyone knows how to use it for can call the files and work together with
  other page ¿?
 
  Thanks
 
  On Sun, Oct 9, 2011 at 6:57 PM, Sean Greenslade zootboys...@gmail.com
 wrote:
 
 
  On Sun, Oct 9, 2011 at 9:52 AM, Ricardo Martinez harisel...@gmail.com
 wrote:
 
  The files are, png, pdf and flv.
 
  Only users login can see or download it.
 
  thx ;
 
  On Sat, Oct 8, 2011 at 11:16 PM, Shawn McKenzie nos...@mckenzies.net
  wrote:
 
   On 10/08/2011 03:40 PM, Ricardo Martinez wrote:
Hi List!
   
I need to access files outside the DocumentRoot.
   
I've been looking for info and documentation, and I've read that it
  can
   be
done using symbolic links and another way is by using headers.
   
I want to know, what do you think, what is the best way, and if
 anyone
   knows
a good doc about of it.
   
Thanks!!!
   
  
   It depends on what you mean by files.  Are they PHP files that need
 to
   be run, or images, or files that need to be downloaded by the user?
  
   For PHP, you would add the external dir to your include path.
  
   For images you can use a php file as the img src and that file sets
 the
   appropriate headers and uses readfile() to get and echo the image
 data:
   getimage.php?image=someimage.gif
  
   For download files you would do it in the same manner as for images:
   download.php?file=somefile.zip
  
  
   --
   Thanks!
   -Shawn
   http://www.spidean.com
  
 
  --
  Ricardo
  ___
  IT Architect
  website: http://www.pulsarinara.com
 
 
 
  Sounds like the downloader php script would be perfect (what Shawn
  suggested). Have the script check the login status, then (if valid) send
 the
  proper headers for the file and read out the data with the script.
 
  --
  --Zootboy
 
  Sent from my PC.
 
 
 
 
  --
  Ricardo
  ___
  IT Architect
  website: http://www.pulsarinara.com
 

 For images and the like, I have a separate page that is called that
 handles the image and the headers needed

 In the page I have some thing like

 echo img src='get_image.php?id=$id';

 Then in the get-image.php page i have the code that gets the image
 from the db, outputs the appropriate headers and then outputs the
 image

 --

 Bastien

 Cat, the other other white meat




-- 
Ricardo
___
IT Architect
website: http://www.pulsarinara.com


Re: [PHP] Re: files outside of documentRoot

2011-10-11 Thread Ricardo Martinez
Hi!

i'm was checking, readfile(); and fpassthru();

With easy examples, i can use it for show a pic in the screen and download a
file, from outside of documentRoot. It works fine.

The problem that i have now, is, i need can work with it, inside of other
documents, but i'm getting all time error by the headers. ( already sendt
... )

Anyone knows how to use it for can call the files and work together with
other page ¿?

Thanks

On Sun, Oct 9, 2011 at 6:57 PM, Sean Greenslade zootboys...@gmail.comwrote:


 On Sun, Oct 9, 2011 at 9:52 AM, Ricardo Martinez harisel...@gmail.comwrote:

 The files are, png, pdf and flv.

 Only users login can see or download it.

 thx ;

 On Sat, Oct 8, 2011 at 11:16 PM, Shawn McKenzie nos...@mckenzies.net
 wrote:

  On 10/08/2011 03:40 PM, Ricardo Martinez wrote:
   Hi List!
  
   I need to access files outside the DocumentRoot.
  
   I've been looking for info and documentation, and I've read that it
 can
  be
   done using symbolic links and another way is by using headers.
  
   I want to know, what do you think, what is the best way, and if anyone
  knows
   a good doc about of it.
  
   Thanks!!!
  
 
  It depends on what you mean by files.  Are they PHP files that need to
  be run, or images, or files that need to be downloaded by the user?
 
  For PHP, you would add the external dir to your include path.
 
  For images you can use a php file as the img src and that file sets the
  appropriate headers and uses readfile() to get and echo the image data:
  getimage.php?image=someimage.gif
 
  For download files you would do it in the same manner as for images:
  download.php?file=somefile.zip
 
 
  --
  Thanks!
  -Shawn
  http://www.spidean.com
 

 --
 Ricardo
 ___
 IT Architect
 website: http://www.pulsarinara.com



 Sounds like the downloader php script would be perfect (what Shawn
 suggested). Have the script check the login status, then (if valid) send the
 proper headers for the file and read out the data with the script.

 --
 --Zootboy

 Sent from my PC.




-- 
Ricardo
___
IT Architect
website: http://www.pulsarinara.com


Re: [PHP] Re: files outside of documentRoot

2011-10-11 Thread Bastien Koert
On Tue, Oct 11, 2011 at 11:00 AM, Ricardo Martinez harisel...@gmail.com wrote:
 Hi!

 i'm was checking, readfile(); and fpassthru();

 With easy examples, i can use it for show a pic in the screen and download a
 file, from outside of documentRoot. It works fine.

 The problem that i have now, is, i need can work with it, inside of other
 documents, but i'm getting all time error by the headers. ( already sendt
 ... )

 Anyone knows how to use it for can call the files and work together with
 other page ¿?

 Thanks

 On Sun, Oct 9, 2011 at 6:57 PM, Sean Greenslade zootboys...@gmail.comwrote:


 On Sun, Oct 9, 2011 at 9:52 AM, Ricardo Martinez harisel...@gmail.comwrote:

 The files are, png, pdf and flv.

 Only users login can see or download it.

 thx ;

 On Sat, Oct 8, 2011 at 11:16 PM, Shawn McKenzie nos...@mckenzies.net
 wrote:

  On 10/08/2011 03:40 PM, Ricardo Martinez wrote:
   Hi List!
  
   I need to access files outside the DocumentRoot.
  
   I've been looking for info and documentation, and I've read that it
 can
  be
   done using symbolic links and another way is by using headers.
  
   I want to know, what do you think, what is the best way, and if anyone
  knows
   a good doc about of it.
  
   Thanks!!!
  
 
  It depends on what you mean by files.  Are they PHP files that need to
  be run, or images, or files that need to be downloaded by the user?
 
  For PHP, you would add the external dir to your include path.
 
  For images you can use a php file as the img src and that file sets the
  appropriate headers and uses readfile() to get and echo the image data:
  getimage.php?image=someimage.gif
 
  For download files you would do it in the same manner as for images:
  download.php?file=somefile.zip
 
 
  --
  Thanks!
  -Shawn
  http://www.spidean.com
 

 --
 Ricardo
 ___
 IT Architect
 website: http://www.pulsarinara.com



 Sounds like the downloader php script would be perfect (what Shawn
 suggested). Have the script check the login status, then (if valid) send the
 proper headers for the file and read out the data with the script.

 --
 --Zootboy

 Sent from my PC.




 --
 Ricardo
 ___
 IT Architect
 website: http://www.pulsarinara.com


For images and the like, I have a separate page that is called that
handles the image and the headers needed

In the page I have some thing like

echo img src='get_image.php?id=$id';

Then in the get-image.php page i have the code that gets the image
from the db, outputs the appropriate headers and then outputs the
image

-- 

Bastien

Cat, the other other white meat

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



[PHP] Re: files outside of documentRoot

2011-10-09 Thread Ricardo Martinez
The files are, png, pdf and flv.

Only users login can see or download it.

thx ;

On Sat, Oct 8, 2011 at 11:16 PM, Shawn McKenzie nos...@mckenzies.netwrote:

 On 10/08/2011 03:40 PM, Ricardo Martinez wrote:
  Hi List!
 
  I need to access files outside the DocumentRoot.
 
  I've been looking for info and documentation, and I've read that it can
 be
  done using symbolic links and another way is by using headers.
 
  I want to know, what do you think, what is the best way, and if anyone
 knows
  a good doc about of it.
 
  Thanks!!!
 

 It depends on what you mean by files.  Are they PHP files that need to
 be run, or images, or files that need to be downloaded by the user?

 For PHP, you would add the external dir to your include path.

 For images you can use a php file as the img src and that file sets the
 appropriate headers and uses readfile() to get and echo the image data:
 getimage.php?image=someimage.gif

 For download files you would do it in the same manner as for images:
 download.php?file=somefile.zip


 --
 Thanks!
 -Shawn
 http://www.spidean.com




-- 
Ricardo
___
IT Architect
website: http://www.pulsarinara.com


Re: [PHP] Re: files outside of documentRoot

2011-10-09 Thread Sean Greenslade
On Sun, Oct 9, 2011 at 9:52 AM, Ricardo Martinez harisel...@gmail.comwrote:

 The files are, png, pdf and flv.

 Only users login can see or download it.

 thx ;

 On Sat, Oct 8, 2011 at 11:16 PM, Shawn McKenzie nos...@mckenzies.net
 wrote:

  On 10/08/2011 03:40 PM, Ricardo Martinez wrote:
   Hi List!
  
   I need to access files outside the DocumentRoot.
  
   I've been looking for info and documentation, and I've read that it can
  be
   done using symbolic links and another way is by using headers.
  
   I want to know, what do you think, what is the best way, and if anyone
  knows
   a good doc about of it.
  
   Thanks!!!
  
 
  It depends on what you mean by files.  Are they PHP files that need to
  be run, or images, or files that need to be downloaded by the user?
 
  For PHP, you would add the external dir to your include path.
 
  For images you can use a php file as the img src and that file sets the
  appropriate headers and uses readfile() to get and echo the image data:
  getimage.php?image=someimage.gif
 
  For download files you would do it in the same manner as for images:
  download.php?file=somefile.zip
 
 
  --
  Thanks!
  -Shawn
  http://www.spidean.com
 

 --
 Ricardo
 ___
 IT Architect
 website: http://www.pulsarinara.com



Sounds like the downloader php script would be perfect (what Shawn
suggested). Have the script check the login status, then (if valid) send the
proper headers for the file and read out the data with the script.

-- 
--Zootboy

Sent from my PC.


[PHP] Re: files outside of documentRoot

2011-10-08 Thread Jim Giner
Access files for use in the running script? Or access files meaning 
executing a script? 



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



[PHP] Re: files outside of documentRoot

2011-10-08 Thread Shawn McKenzie
On 10/08/2011 03:40 PM, Ricardo Martinez wrote:
 Hi List!
 
 I need to access files outside the DocumentRoot.
 
 I've been looking for info and documentation, and I've read that it can be
 done using symbolic links and another way is by using headers.
 
 I want to know, what do you think, what is the best way, and if anyone knows
 a good doc about of it.
 
 Thanks!!!
 

It depends on what you mean by files.  Are they PHP files that need to
be run, or images, or files that need to be downloaded by the user?

For PHP, you would add the external dir to your include path.

For images you can use a php file as the img src and that file sets the
appropriate headers and uses readfile() to get and echo the image data:
getimage.php?image=someimage.gif

For download files you would do it in the same manner as for images:
download.php?file=somefile.zip


-- 
Thanks!
-Shawn
http://www.spidean.com

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