Re: Re: files outside of documentRoot

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

 



On Sun, Oct 9, 2011 at 9:52 AM, Ricardo Martinez <hariseldom@xxxxxxxxx>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 <nospam@xxxxxxxxxxxxx
> >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.

[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