Re: Web friendly file names

From: Date: Wed, 03 Jun 2009 17:23:42 +0000
Subject: Re: Web friendly file names
References: 1 2 3 4 5 6 7  Groups: php.general 
Request: Send a blank email to php-general+get-293552@lists.php.net to get a copy of this message
On Wed, Jun 3, 2009 at 1:18 PM, Eddie Drapkin <oorza2k5@gmail.com> wrote: > As far as I know it will only bug out when the host filesystem would bug > out, ie UTF-16 characters tend to explode on my linux setup that I develop > on, and PHP's file handlign doesn't like them, but then again neither does > the filesystem.  Stuff like "Some silly name! YAY#####" work fine, on the > other hand. > > On Wed, Jun 3, 2009 at 1:00 PM, Skip Evans <skip@bigskypenguin.com> wrote: > >> Oh, of course that makes sense, and I suppose the PHP move_uploaded_file() >> function has no problem with weird and crappy file names? >> >> Skip >> >> Eddie Drapkin wrote: >> >>> Well, erm, no. >>> >>> I'd store the filename, etc. as-is in the database, and then link it with >>> urlencode() and you should be able to serve a file called "A non friendly >>> name!" site.com/A%20non%20friendly.. >>> <http://site.com/A%20non%20friendly..>.. >>> and a modern webserver should be fine with that, and even most browsers will >>> allow you to type site.com/A <http://site.com/A> >>> non friendly... without >>> the url escaped characters and it will url escape them in the request.  The >>> only issue is that the urlencoded special characters are a lot uglier, which >>> may or may not be a consideration for you. >>> >>> On Wed, Jun 3, 2009 at 12:39 PM, Skip Evans <skip@bigskypenguin.com<mailto: >>> skip@bigskypenguin.com>> wrote: >>> >>> >> -- >> ==================================== >> Skip Evans >> Big Sky Penguin, LLC >> 503 S Baldwin St, #1 >> Madison WI 53703 >> 608.250.2720 >> http://bigskypenguin.com >> ------------------------------------ >> Those of you who believe in >> telekinesis, raise my hand. >>  -- Kurt Vonnegut >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> > how about just hashing the filename? Store them in a week-year folder and store a record in the db with the real file name and the hash. -- Bastien Cat, the other other white meat

« previous php.general (#293552) next »