PHP file_exists cannot check file name like "A &B.jpg"

  • httpftp21
  • Graduate
  • Graduate
  • httpftp21
  • Posts: 101

Post 3+ Months Ago

hello All,

I am using file_exists to chk whether file is present or not.

But for files like
"Brick-&-Stone-Paver-#972-880-2-Dallas-TX-1452.jpg" it is not able to read it though the file is present in the directory.


Can anyone suggest any turn around for this problem.

THX U ALL in ADV.
  • BooGiE_MaN
  • Proficient
  • Proficient
  • User avatar
  • Posts: 387
  • Loc: Cape Town, South Africa

Post 3+ Months Ago

Maybe try url_encode()?

It would be best to try strip any punctuation from file names before they are uploaded (except for the .jpg of course)
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13504
  • Loc: Florida

Post 3+ Months Ago

Are you running htmlentities() on the filename before you look for it ?

The inclusion of "&" in your example looks a little odd.
  • Dorky
  • Novice
  • Novice
  • Dorky
  • Posts: 15

Post 3+ Months Ago

yeah im sure you can do without the funky file name. dont buy a new car for a flat tire, just change the tire.

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 78 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.