file_exists(), is_file() & is_dir() with spaces?
Posted on June 26, 2007
Why won't file_exists(), is_file(), is_dir() return true if the file or directory has a space in it?
I spent a few hours trying all kinds of ways to make this work. I finally settled on using $file->setName("safe"); from PEAR's HTTP_Upload class which makes the uploaded file "safe".
What's safe?
Related posts
- Detecting MIME types in PHP
Detecting MIME types in PHP used to be hellish. Use the mime_content_type function I hear... - The Beauty of Old Code
A client of mine needed a quick image upload feature to a custom administration app.... - Making user inputted data safe
I like to use the PEAR library HTML_Safe to clean up any user input I... - Install Imagemagick / Imagick for PHP on Ubuntu
No problem if you want to install imagemagick on your server, Ubuntu makes this very... - New Roll Cage
Out came the dash dodging bolt in to make way for the weld in. Theres...



November 23rd, 2009 - 21:01
Hey bro, just wanted to say thanks for the tip, I’m also using HTTP_Upload and had the same problem as you, so the workaround was perfect for me. For what it’s worth, your blog post has saved others the same headache you had to experience, so thank you!