You are here: Re: Securely serving files « PHP Programming Language « IT news, forums, messages
Re: Securely serving files

Posted by Nicholas Sherlock on 02/12/06 12:00

Jasen Betts wrote:
> On 2006-02-12, Nicholas Sherlock <N.sherlock@gmail.com> wrote:
>> The Symlink() command? Awesome!
>
> symlinks depend on the apache configuration.
>
> hard links (the link() function) are indistinguishable from
> real files.
>
> as long as the file you're linking to is on the same partition as the web
> site (and is readable by PHP - you already said it was) link() is probably
> the best way to go.

I'm using Symlink() right now with success. What is the difference
between hard links and symlinks? Is there any reason to switch?

>
>>> Store the names and delete any that have been sitting there for more than 30
>>> seconds, or spawn a background script that sleeps for 30 seconds and then
>>> deletes the copy.
>
> shell_exec (" ( sleep 30 ; rm '$filename' ) &");
>
> but that doesn't work in safe mode... :( someone else may have an
> alternative.

Since it isn't that critical when the link expires, I just delete all
previous links every time I create a link. Hopefully there won't be any
concurrency issues there.

In safe mode, the folders that you create with mkdir get Apache's ID,
not the ID of the script, and are therefore not accessible from PHP
scripts. The solution was to use the ftp_* functions of PHP to create a
folder, which then has the correct ID for access.

Cheers,
Nicholas Sherlock

Cheers,
Nicholas Sherlock

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация