Reply to Re: Uploading files with an apostrophe in the filename

Your name:

Reply:


Posted by Beauregard T. Shagnasty on 05/13/07 22:58

In alt.www.webmaster, Alfred Molon wrote:

> For instance, if I upload the file "Al Azhar's mosque Cairo.jpg" (with
> the apostrophe), the PHP code will automatically convert the filename
> to "Al Azhar\'s mosque Cairo.jpg" (i.e. insert a backslash) and store
> a file named "Al Azhar\'s mosque Cairo.jpg" in the temporary
> directory.
>
> Then for misterious reasons it will convert the filename to "Al Azhar
> \\\'s mosque Cairo.jpg" (i.e. insert two more backslashs). This
> happens after the filename has been passed as a POST parameter to
> another script.

Look up htmlentities.

Though it would likely be much easier if you were to strip out all
characters except alpha, numeric, and the underscore prior to storage
(file and database entry). Perhaps replace spaces with underscores.

--
-bts
-Motorcycles defy gravity; cars just suck

[Back to original 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

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