Paving the way for .NET in Tonga
| Browse in : |
All
> Soap Box
All > Soap Box > bTonga Any of these categories - All of these categories |
There is a problem with WordPress 2.0 and support for XML file uploads (using MetaweblogAPI NewMediaObject)
As I understand the error, and my whacked solution, the 1st part of the error seems to be an innocuous typing mistake. (i.e. uploads instead of upload [without the 's']) The 2nd part, I'm not too sure of, but things do work when adding a false value to 'error'.
I hope this helps those with WordPress 2.0 and errors with their blog clients.
Visit bTonga
Note: Looking at the "trunk" latest code on their server, it seems the problem has been picked up earlier and I just missed on getting the 'old' code.
--- functions-post.php-org Mon Dec 26 10:16:27 2005
+++ functions-post.php Mon Jan 9 15:10:45 2006
@@ -894,7 +894,7 @@
while ( file_exists($upload['path'] . "/$filename") )
$filename = str_replace("$number.$ext", ++$number . ".$ext", $filename);
- $new_file = $uploads['path'] . "/$filename";
+ $new_file = $upload['path'] . "/$filename";
$ifp = @ fopen($new_file, 'wb');
if ( ! $ifp )
return array('error' => "Could not write file $new_file.");
@@ -909,7 +909,7 @@
// Compute the URL
$url = $upload['url'] . "/$filename";
- return array('file' => $new_file, 'url' => $url);
+ return array('file' => $new_file, 'url' => $url, 'error' => false);
}
?>
There are no comments attached to this item.