Thanks. Here is what I&#39;m now using... <div><br></div><div><div><div>html jQuery ajax </div><div><span class="Apple-tab-span" style="white-space:pre">        </span>callback: [:value | </div><div><span class="Apple-tab-span" style="white-space:pre">                </span>| writestream | <span class="Apple-tab-span" style="white-space:pre">                        </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>writestream := ((&#39;c:\data\sketchpad_&#39;, Time now asSeconds printString ,&#39;.png&#39;) asFilename withEncoding:  #binary) writeStream.</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>[writestream nextPutAll: (Seaside.GRPlatform current base64Decode: value) asByteArray] ensure: [writestream close]] </div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>value: (Javascript.JSStream on: &#39;sketchpadCanvas.toDataURL()&#39;)</div></div><div><br></div><div>...but I got an exception in Net.MimeScanner class&gt;&gt;decodeBase64From:to:in:on: </div>
<div><br></div><div>aString size is 17074 and the code iterates over the string, checking a #limit which is set to the string size. But the code checks for index + 3 which exceeds the string size.  Hacking the code so the limit is set to size - 3 works, but the resulting image is not a valid PNG file.</div>
<div><br></div><div>Is there is way to test the decoded content to see if it is a valid PNG file?</div><div><br></div><div>I also tried toDataURL(&quot;image/jpeg&quot;) which created an output starting with &#39;data:image/jpeg;base64&#39; but that also saved an invalid image file.</div>
<div><br></div><div>Bob </div><br><div class="gmail_quote">On Wed, Jul 27, 2011 at 10:23 AM, Philippe Marschall <span dir="ltr">&lt;<a href="mailto:philippe.marschall@gmail.com">philippe.marschall@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">2011/7/27 Bob N. &lt;<a href="mailto:bobn@rogers.com">bobn@rogers.com</a>&gt;:<br>
<div class="im">&gt; Thanks Johan, feels like I almost have it.<br>
&gt; I&#39;m doing this work in VW. Could someone show the VW equivalent of<br>
&gt; #base64Decoded? Or is it in some Seaside compatibility library? I&#39;m using<br>
&gt; &#39;Seaside 3.0 - 87&#39; from the Cincom public repository.<br>
<br>
</div>GRPlatform current base64Decode:<br>
<br>
Cheers<br>
<font color="#888888">Philippe<br>
</font><div><div></div><div class="h5">_______________________________________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
</div></div></blockquote></div><br></div>