Possible Duplicate:
CURLOPT_FOLLOWLOCATION cannot be activated
I am using a WordPress plugin on my WordPress site to upload a series of images. It always works fine, unless the image urls got spaces in them. I tried using urlencode but I am still getting errors. This is the code where it breaks:
When I echo
out $img
it's
"http://omodaimg.xcdn.nl/RM1000,1000/taupe-paul-green-sneakers-1157/PAUL GREEN/31024_1.png"
without the quotes.
foreach ($imgs as $img) {
$image_filename = wp_unique_filename($uploads['path'], basename(parse_url(trim($img), PHP_URL_PATH)));
$image_filepath = $uploads['path'] . '/' . $this->url_title($image_filename);
if ( ! file_put_contents($image_filepath, @file_get_contents(trim($img)))) {
if (! get_file_curl(trim($img), $image_filepath)) {
$logger and call_user_func($logger, sprintf(__('<b>ERROR</b>: File %s cannot be saved locally as %s', 'pmxi_plugin'), trim($img), $image_filepath));
unlink($image_filepath); // delete file since failed upload may result in empty file created
}
}
Is anyone seeing with I am not seeing? Any hints in the right direction are very much appreciated.