<br><br><div class="gmail_quote">On Tue, Jul 21, 2009 at 4:58 PM, Brian Mason <span dir="ltr">&lt;<a href="mailto:bmason@itassociates.com">bmason@itassociates.com</a>&gt;</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;">









<div link="blue" vlink="purple" lang="EN-US">

<div>

<p>Greetings,</p>

<p> </p>

<p>I am trying to take an image off the new and save it to a
file.  This is what I have so far:</p>

<p> </p>

<p>(FileStream newFileNamed: &#39;test.jpg&#39;)</p>

<p>                nextPutAll:
(&#39;<a href="http://freetalklive.com/images/amondson.jpg" target="_blank">http://freetalklive.com/images/amondson.jpg</a>&#39;  asUrl retrieveContents)
getContentFromStream;</p>

<p>                close</p>

<p> </p>



<p>The image exists, is found, and the file is written. 
There is something wrong with the format of the local jpg. <br></p></div></div></blockquote></div><br clear="all">Your stream needs to be &quot;binary&quot;. Don&#39;t ask me more than about this; I only discovered it through trial, error and reading the code for HTTPSocket&gt;&gt;httpJpeg:<br>
<br>image := &#39;<a href="http://freetalklive.com/images/amondson.jpg">http://freetalklive.com/images/amondson.jpg</a>&#39;  asUrl retrieveContents.<br>f := (FileStream newFileNamed: &#39;test.jpg&#39;).<br>
f binary.<br>f nextPutAll: image content.<br>f close.<br><br>or for your style of coding: <br>

<p>(FileStream newFileNamed: &#39;test.jpg&#39;) binary;<br></p><p>                nextPutAll:
(&#39;<a href="http://freetalklive.com/images/amondson.jpg" target="_blank">http://freetalklive.com/images/amondson.jpg</a>&#39;  asUrl retrieveContents) content;</p>

<p>                close.</p>

<br><br>Gulik.<br><br>-- <br><a href="http://gulik.pbwiki.com/">http://gulik.pbwiki.com/</a><br>