Page 1 of 1
Image embedder and spaces in filenames
Posted: Wed Dec 05, 2007 2:07 pm
by afwt
It looks like this doesn't work. Out of 20 images in my email, only three (the ones with spaces in filenames) were omitted. What preg should I change to make these included too, does anybody know?
Thanks in advance.
Posted: Wed Dec 05, 2007 2:13 pm
by John Cartwright
I'm not sure why it didn't work, but try passing the filename through urlencode() to encode the spaces.
Posted: Thu Dec 06, 2007 12:13 am
by afwt
I apologize for not specifying before: I'm using
FileEmbedder plugin, I'm not doing anything, I believe the pattern is bad, the one that grabs image URLs...

Posted: Tue Dec 11, 2007 9:17 pm
by Chris Corbyn
Spaces shouldn't affect it. It's looking for all bytes in the ascii range by default. More likely an incorrect file path would affect it. What does realpath() show? Also is this a remote file (over HTTP/FTP) or a local file on disk?
Posted: Thu Dec 27, 2007 11:13 am
by afwt
I apologize for not responding earlier. No need for realpath(), yes, it is a remote file, it is included via URL as specified in my previous response.

Posted: Tue Jan 01, 2008 8:19 pm
by Chris Corbyn
afwt wrote:yes, it is a remote file
In that case you can't legally have spaces in the filename since URLs should never contain spaces. urlencode() the path, or replace your spaces with "+" or "%20".