Hello Michael, <div><br><div>i have started to deal with  file uploading and found several problems </div><div><br></div><div>1. The Yesod restricts file upload for non-small files http response is <i><b>Status: 413 Request Entity Too Large. </b></i></div>

<div><i style="font-weight: bold; ">    </i>How can change this ?</div><div>2. Yesod does not recognize file uploding via XHR. The <span class="Apple-style-span" style="font-family: &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace; font-size: 12px; line-height: 17px; white-space: pre; background-color: rgb(255, 255, 255); "><b>runRequestBody </b>function returns the empty files list.</span></div>

<div><span class="Apple-style-span" style="font-family: &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace; font-size: 12px; line-height: 17px; white-space: pre; background-color: rgb(255, 255, 255); ">  </span>How to see the uploading file content ?</div>

<div><br></div><div>Thanks.</div><div><span class="Apple-style-span" style="font-family: &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace; font-size: 12px; line-height: 17px; white-space: pre; background-color: rgb(255, 255, 255); "><br>

</span></div><div><br><div class="gmail_quote">2011/6/22 Michael Snoyman <span dir="ltr">&lt;<a href="mailto:michael@snoyman.com">michael@snoyman.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

In general, the recommended approach is to store binary files on the<br>
filesystem instead of in the database. In the Yesod wiki, I violate<br>
that :(. It&#39;s significantly more complicated than what you&#39;re looking<br>
for, since it&#39;s parsing an entire ZIP file and pulling out<br>
DITA-formatted XML, but you can look at the relevant file:<br>
<a href="https://github.com/snoyberg/yesodwiki/blob/master/Handler/UploadDitamap.hs" target="_blank">https://github.com/snoyberg/yesodwiki/blob/master/Handler/UploadDitamap.hs</a><br>
<br>
Note that I currently base64-encode the content since HDBC-postgresql<br>
has problems with binary data. I&#39;m hoping that gets resolved (or that<br>
we move over to Chris&#39;s new PostgreSQL library).<br>
<font color="#888888"><br>
Michael<br>
</font><div><div></div><div class="h5"><br>
On Wed, Jun 22, 2011 at 7:34 PM, Anton Cheshkov &lt;<a href="mailto:acheshkov@gmail.com">acheshkov@gmail.com</a>&gt; wrote:<br>
&gt; Hi Michael,<br>
&gt; please tell about the best way you see to upload  store  and render pictures<br>
&gt; in the Yesod application.<br>
&gt; How is better to store the pictures either file system or  DB.<br>
&gt; It would be great to see the code example shows how to upload store and<br>
&gt; render just uploaded pictures with Yesod.<br>
&gt; I think you have something like this already.<br>
&gt;<br>
&gt; Thanks.<br>
&gt;<br>
&gt; --<br>
&gt; Best regards,<br>
&gt; Cheshkov Anton<br>
&gt;<br>
&gt;<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Best regards,<br>Cheshkov Anton <br>Phone: +7 909 005 18 82<br>Skype: cheshkov_anton<br>
</div></div>