Ask a Question related to PHP Development, Design and Development.
-
- Edwin - #1
Re: [PHP] Protecting a file via PHP.
Hi,
"Steve Jackson" <stephen.jackson@violasystems.com> wrote:
Didn't really read this but...> I just read this:
> [url]http://zend.com/zend/trick/tricks-august-2001.php[/url]
> To protect a file via PHP.
It should be "from" and not "to".> What does this part mean in the serving the files part:
> define('FILEDIR', '/mnt/dos/');
>
> Do I define the directory where the file is served from? Or do I define
> a directory to which the file is served to (a temp) or what?
Could be a different problem...> No matter
> what I've tried I get no error message and the browser (IE6) just hangs
> so it appears that PHP is trying to serve the file but failing for some
> reason.
- E -
__________________________________________________
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!
[url]http://bb.yahoo.co.jp/[/url]
- Edwin - Guest
-
Protecting Video
VJ, I'm looking for a way to protect my QT videos from being taken off the distributed cd-rom by the customer. Is there a way to prohibit someone... -
PROTECTING FREEHAND FILE!
How can i protect my freehand files, that others can't chenge my files. -
[PHP] Getting part of a string...Was protecting a file via php
Thanks to all so far. However I am still having problems I have directory outside the root with PDF's in it. The links to the PDF files are called... -
Getting part of a string...Was protecting a file via php
OK, After much headbanging I figured out the first part of my problem. I want to retrieve a file from behind the webroot and to do this I need to... -
protecting CD contents
I want to create a front end to a CD that requires a password to access the PDFs contained on the CD. What is the best way to do this so that... -
Steve Jackson #2
FW: [PHP] Protecting a file via PHP.
Steve Jackson
Web Development and Marketing Manager
Viola Systems Ltd.
[url]http://www.violasystems.com[/url]
[email]stephen.jackson@violasystems.com[/email]
Mobile +358 50 343 5159
-----Original Message-----
From: Steve Jackson [mailto:stephen.jackson@violasystems.com]
Sent: 16. syyskuuta 2003 12:15
To: 'copperwa11s@yahoo.co.jp'
Subject: RE: [PHP] Protecting a file via PHP.
OK. The thing is I wonder why in the zend article the directory here is>> > What does this part mean in the serving the files part:
> > define('FILEDIR', '/mnt/dos/');
> >
> > Do I define the directory where the file is served from? Or do I
> > define a directory to which the file is served to (a temp) or what?
> It should be "from" and not "to".
different. There are two scripts on the page: <?
define('FILEDIR', '/downloads/');
//display available files
$d = dir(FILEDIR);
while($f = $d->read())
{
//skip 'hidden' files
if($f{0} != '.')
{
print("<a href=\"get.php?file=$f\">$f</a><br>\n");
}
}
$d->close();
?>
This first one looks in the downloads directory (outside the root) and
grabs the filenames displaying them as a link. This works fine on my
server.
This second one starts with:
define('FILEDIR', '/mnt/dos/');
And I can't see an explanation why. Surely if it was meant to be the
same the writer would have had the same route defined?
Could be. But I'm trying to eliminate this one first. I've tried the>
> Could be a different problem...
>
from directory and get the same error as I menioned previously. If I
can't get this to work are there any other ways I can protect a file
from being displayed. I need to be able to:
1) Display links to authenticated users (php session)
2) Let authenticated users download the files.
I don't want to use an htaccess file unless there is a way to
authenticate the user in htaccess by reading the session variable.
Steve Jackson Guest



Reply With Quote

