Jump to content


Photo

Pagefile.php changing filenames


  • Please log in to reply
2 replies to this topic

#1 MarcC

MarcC

    Sr. Member

  • Members
  • PipPipPipPip
  • 252 posts
  • 60

  • LocationCalifornia

Posted 04 June 2012 - 12:59 PM

Had a little error crop up today...posting attachments to the site via POP3 email retrieval...

Pagefile.php line 88

$filename = str_replace(' ', '%20', trim($filename));


About which my partner in crime says:

You can't just freaking change the filename I passed in!! Of course
the system copy command isn't going to be able to find a file by that
new name, because that's not the name of my damn file--my filename had
spaces, not %20s.

Maybe Ryan already fixed this in a future version, but in the meantime
I will remove spaces myself so that this doesn't happen..


:) Thoughts?

I'm a freelance, processwire-using web designer based in california. work site | personal site | visuals


#2 ryan

ryan

    Hero Member

  • Administrators
  • 5,771 posts
  • 3107

  • LocationAtlanta, GA

Posted 06 June 2012 - 10:56 AM

Not sure about this one. Another user had requested that we add that str_replace(' ', '%20', $filename) in the past because it apparently wasn't working without it on filenames that have spaces (and that's why it's there). Sounds like this behavior may depend on the environment. I would never think to use spaces in filenames for anything like this, so can't say as though I know exactly how to tailor this to everyone. But I've added another check in there and pushed it to the source. Though not sure if this will help in this particular situation or not. Either way I recommend avoiding filenames with spaces as that's not very portable. But give the update a try and let me know if it makes any difference here.

#3 MarcC

MarcC

    Sr. Member

  • Members
  • PipPipPipPip
  • 252 posts
  • 60

  • LocationCalifornia

Posted 11 June 2012 - 12:33 PM

Thanks for adding that check, Ryan. It looks like that should work just fine.

I'm a freelance, processwire-using web designer based in california. work site | personal site | visuals





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users