Page 1 of 1
access files outside document root??
Posted: Wed Sep 24, 2008 6:52 am
by pcoder
Hi,
I need to access some files that are located outside the document root.
And is there any way to access those files? i wonder if i can access the files that are located outside the document root.
Thanks
Re: access files outside document root??
Posted: Wed Sep 24, 2008 12:57 pm
by califdon
What do you mean by "access"? The web server will not serve a page that's outside document root, but you can use php to read any file if you have read privileges for it, and feed the data to the web server.
Re: access files outside document root??
Posted: Wed Sep 24, 2008 11:00 pm
by pcoder
Thanks for the reply Califdon.
Actually, according to the client , they don't want to put any video files inside the document root.
And, the files are placed inside the another directory which is outside the document root. I have to access, i mean to play these files from the browser.
Is this possible??
Re: access files outside document root??
Posted: Thu Sep 25, 2008 7:13 am
by Darkzaelus
No it isn't.
Playing video files is done client side, so if the client can't see them in the browser, then it can't play them.
Cheers,
Darkzaelus.
Re: access files outside document root??
Posted: Thu Sep 25, 2008 7:25 am
by pcoder
Thanks for the reply Darkzaelus.
We can play the footage from the server location. Like:
http://localhost/footage/test.mpg.
Which is inside the document root.
I think it is preety impossible. I wonder if there is any way to play footage outside the document root.
Re: access files outside document root??
Posted: Thu Sep 25, 2008 7:28 am
by VladSun
You may use
readfile(), even
passthru() or whatever file-read function you like

Re: access files outside document root??
Posted: Thu Sep 25, 2008 7:41 am
by Darkzaelus
From the client browser??
Or are you making a php file load the data and set the mime type?
Cheers,
Darkzaelus.
Re: access files outside document root??
Posted: Thu Sep 25, 2008 7:42 am
by VladSun
Darkzaelus wrote:Or are you making a php file load the data and set the mime type?
Yes

Re: access files outside document root??
Posted: Thu Sep 25, 2008 7:43 am
by Darkzaelus
Genius

Just pseudo-streaming isn't it. And if they come back without a grabber, they can't get the data!
Kudos to you,
Darkzaelus