[web-devel] Yesod, picture uploading, storing, rendering

Anton Cheshkov acheshkov at gmail.com
Sun Jun 26 12:40:29 CEST 2011


Hello Michael,

i have started to deal with  file uploading and found several problems

1. The Yesod restricts file upload for non-small files http response
is *Status: 413
Request Entity Too Large. *
*    *How can change this ?
2. Yesod does not recognize file uploding via XHR. The *runRequestBody
*function
returns the empty files list.
 How to see the uploading file content ?

Thanks.


2011/6/22 Michael Snoyman <michael at snoyman.com>

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



-- 
Best regards,
Cheshkov Anton
Phone: +7 909 005 18 82
Skype: cheshkov_anton
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/web-devel/attachments/20110626/b312bdf6/attachment.htm>


More information about the web-devel mailing list