It works!<br><br>Thanks again for the help.<br><br>On really large images, I get a "transport error" - I assume that's some sort of timeout issue or something.<br><br><div class="gmail_quote">On Mon, Apr 13, 2009 at 6:34 PM, David Weiss <span dir="ltr"><<a href="mailto:dave@daveweiss.net">dave@daveweiss.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">And my starting point for getting the file into $data is this:<br><br><div>
<div><code><span style="color: rgb(0, 0, 0);">
<span style="color: rgb(0, 0, 187);"><?php<br></span><span style="color: rgb(255, 128, 0);">// get contents of a file into a string<br></span><span style="color: rgb(0, 0, 187);">$filename </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(221, 0, 0);">"path-to-file"</span><span style="color: rgb(0, 119, 0);">;<br>
</span><span style="color: rgb(0, 0, 187);">$handle </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">fopen</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$filename</span><span style="color: rgb(0, 119, 0);">, </span><span style="color: rgb(221, 0, 0);">"r"</span><span style="color: rgb(0, 119, 0);">);<br>
</span><span style="color: rgb(0, 0, 187);">$data </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">fread</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$handle</span><span style="color: rgb(0, 119, 0);">, </span><span style="color: rgb(0, 0, 187);">filesize</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$filename</span><span style="color: rgb(0, 119, 0);">));<br>
</span><span style="color: rgb(0, 0, 187);">fclose</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$handle</span><span style="color: rgb(0, 119, 0);">);<br></span><span style="color: rgb(0, 0, 187);">?><br>
<br><br></span>
</span>
</code></div>
</div>I'll let you all know if it works or not.<br><br><div class="gmail_quote"><div><div></div><div class="h5">On Mon, Apr 13, 2009 at 4:43 PM, Joseph Scott <span dir="ltr"><<a href="mailto:joseph@josephscott.org" target="_blank">joseph@josephscott.org</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5"><div><br><div><div><div>On Apr 13, 2009, at 3:21 PM, David Weiss wrote:</div>
<br><blockquote type="cite"><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">Yeah, I saw that function at<span> </span><a href="http://php.net" target="_blank">php.net</a>, and the user feedback just makes what seems like a simple function call completely confusing.<br>
<br>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.<br></span></blockquote>
<div><br></div><div><br></div></div><div>I can confirm that it does work with PHP :-)</div><div><br></div><div>Using the IXR library that WordPress ships with you need to make sure that the field is correctly marked up as base64:</div>
<div><br></div><div>$file_data = new IXR_Base64( $data );</div><div><br></div><div>The IXR_Base64 class takes care of calling the base64_encode() function for you.</div><div><div><br></div><br><blockquote type="cite">
<span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><br>
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.</span></blockquote>
</div></div><font color="#888888"><br><div> <span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div>
<span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div>
<br>--</div><div>Joseph Scott</div><div><a href="mailto:joseph@josephscott.org" target="_blank">joseph@josephscott.org</a></div><div><a href="http://josephscott.org/" target="_blank">http://josephscott.org/</a></div><div>
<br></div></span><br></div></span><br> </div><br></font></div><br></div></div><div class="im">_______________________________________________<br>
wp-xmlrpc mailing list<br>
<a href="mailto:wp-xmlrpc@lists.automattic.com" target="_blank">wp-xmlrpc@lists.automattic.com</a><br>
<a href="http://lists.automattic.com/mailman/listinfo/wp-xmlrpc" target="_blank">http://lists.automattic.com/mailman/listinfo/wp-xmlrpc</a><br>
<br></div></blockquote></div><br>
</blockquote></div><br>