The only problem I can think of is the spaces found in the URL, most likely in the file name. All spaces in the URL must be converted to their correct encoding, which is% 20.
If you have a file name like this:
" http://www.somewhere.com/images/img 1.jpg"
You would get the above error, but with this:
" http://www.somewhere.com/images/img%201.jpg "
You should have problems.
Just use str_replace()
to replace spaces (") for their proper encoding ("% 20 ")
It looks like this:
$url = str_replace(" ", "%20", $url);
For more information on str_replace()
check out the PHP Manual .
Cello_Guy
source share