You are here: Re: OT: security « PHP Programming Language « IT news, forums, messages
Re: OT: security

Posted by Umberto Salsi on 10/15/07 17:53

Michael Fesser <netizen@gmx.de> wrote:

> There are two possible solutions:
>
> 1) Use a whitelist approach,
[...]
>
> The better way:
>
> 2) Don't let users download the files directly. Store them outside the
> document root [...]

3) Store all the meta-data in the DB (full file name, MIME type, upload date,
user name, description, expiry date, access rights, ...), mark this record
with a primary key PK (a number) and then use this number as file name where
the file gets saved, possibly outside the document root of the WEB server.

Remarks: always save the MIME type as provided by the client, never rely on
the "extension", there are much more MIME types than available three-letters
readable codes. Moreover, correctly handling MIME types automatically
makes your application suitable to handle any type of content, past,
present and future.

Best regards,
___
/_|_\ Umberto Salsi
\/_\/ www.icosaedro.it

 

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

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