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: 'Bitstream Vera Sans Mono', 'Courier New', 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: 'Bitstream Vera Sans Mono', 'Courier New', 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: 'Bitstream Vera Sans Mono', 'Courier New', 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"><<a href="mailto:michael@snoyman.com">michael@snoyman.com</a>></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's significantly more complicated than what you're looking<br>
for, since it'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'm hoping that gets resolved (or that<br>
we move over to Chris'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 <<a href="mailto:acheshkov@gmail.com">acheshkov@gmail.com</a>> wrote:<br>
> Hi Michael,<br>
> please tell about the best way you see to upload store and render pictures<br>
> in the Yesod application.<br>
> How is better to store the pictures either file system or DB.<br>
> It would be great to see the code example shows how to upload store and<br>
> render just uploaded pictures with Yesod.<br>
> I think you have something like this already.<br>
><br>
> Thanks.<br>
><br>
> --<br>
> Best regards,<br>
> Cheshkov Anton<br>
><br>
><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>