Re: Web friendly file names
| From: | Eddie Drapkin | Date: | Wed, 03 Jun 2009 17:18:13 +0000 |
| Subject: | Re: Web friendly file names | ||
| References: | 1 2 3 4 5 6 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-293551@lists.php.net to get a copy of this message | ||
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
>
>