[wp-xmlrpc] New Media Object

David Weiss dave at daveweiss.net
Tue Apr 14 16:44:48 GMT 2009


It works!

Thanks again for the help.

On really large images, I get a "transport error" - I assume that's some
sort of timeout issue or something.

On Mon, Apr 13, 2009 at 6:34 PM, David Weiss <dave at daveweiss.net> wrote:

> And my starting point for getting the file into $data is this:
>
>  <?php
> // get contents of a file into a string
> $filename = "path-to-file";
> $handle = fopen($filename, "r");
> $data = fread($handle, filesize($filename));
> fclose($handle);
> ?>
>
>
>  I'll let you all know if it works or not.
>
> On Mon, Apr 13, 2009 at 4:43 PM, Joseph Scott <joseph at josephscott.org>wrote:
>
>>
>> On Apr 13, 2009, at 3:21 PM, David Weiss wrote:
>>
>> Yeah, I saw that function at php.net, and the user feedback just makes
>> what seems like a simple function call completely confusing.
>>
>> I'll monkey around with it a bit and see what I can accomplish.  I was
>> hoping to avoid a day or two of fiddling with this by just seeing if anyone
>> has actually used this API and made it work using PHP.
>>
>>
>>
>> I can confirm that it does work with PHP :-)
>>
>> Using the IXR library that WordPress ships with you need to make sure that
>> the field is correctly marked up as base64:
>>
>> $file_data = new IXR_Base64( $data );
>>
>> The IXR_Base64 class takes care of calling the base64_encode() function
>> for you.
>>
>>
>>
>> BTW, I'm on a Mac.  I totally made the switch.  The only thing I use my PC
>> for is IE7 testing, because I don't want to run Parallels or anything like
>> that on my souped up MacBook Pro.  I'll check out MarsEdit.
>>
>>
>>
>> --
>> Joseph Scott
>> joseph at josephscott.org
>> http://josephscott.org/
>>
>>
>>
>>
>>
>> _______________________________________________
>> wp-xmlrpc mailing list
>> wp-xmlrpc at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-xmlrpc
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://comox.textdrive.com/pipermail/wp-xmlrpc/attachments/20090414/d3182bd8/attachment.htm


More information about the wp-xmlrpc mailing list