jacksonh / manos

Manos is an easy to use, easy to test, high performance web application framework that stays out of your way and makes your life ridiculously simple.
Other
455 stars 61 forks source link

File upload fail #120

Closed txdv closed 13 years ago

txdv commented 13 years ago

When file uploading using the following test case:

<form method="post" action="/screenshots" enctype="multipart/form-data">
  <input name="screenshot" type="file" size="50" accept="image/*" /><br />
  <input type="submit" />
</form>

Manos crashes.

ghost commented 13 years ago

Can't reproduce with latest master, and with latest working master before that. Can you add more info?

txdv commented 13 years ago

Hmm interesting, ill try to pull. I'm working on top of 3a3370c0865c5617d340f251648c7ef8aadfd638

jacksonh commented 13 years ago

In the future lets try writing bug reports in a less confrontational manner.

konrad-kruczynski commented 13 years ago

It can be related to https://github.com/jacksonh/manos/issues/109

dannydulai commented 13 years ago

It doesnt crash on 8ac5718f791b02fd02ccdaf54a567e3175c0324b, but it doesnt match if you do route by attribute to a method that takes 'screenshot' as a byte[] or anything else I can think of.

jacksonh commented 13 years ago

I believe that uploaded files wont effect routing at all. They just get added to the Request.Files collection. Maybe having them get passed into the method as FileInfo or byte[] is a good idea....

dannydulai commented 13 years ago

you can't do it as a FileInfo because it may be an InMemoryUploadedFile, but maybe you can do it if the arg is a Manos.Http.UploadedFile

byte[] works too, but it requires you read entire thing into another copy :-(

jacksonh commented 13 years ago

yeah, we could always do a little magic. Maybe just using UploadedFile is best. It would be a pretty easy hack to add that to the param matching code.

txdv commented 13 years ago

This issue can be closed, it works again.