[Yanel-dev] Upload a file

Michael Wechner michael.wechner at wyona.com
Fri Feb 25 20:14:29 CET 2011


On 2/25/11 8:47 AM, Balz Schreier wrote:
> Thank you all, for giving prompt answers.
> The reason why it does not work in my case is the following:
>
> - getEnvironment().getRequest() does NOT RETURN the original request!! 
> You get an HttpRequest object (which is a Yanel class).
>
> If the incoming request is a multipart POST, yanel already parses it 
> and takes out the payload from the request! This is why my code did 
> not find any content anymore.
>
> So from my perspective it is not ok the way 
> how getEnvironment().getRequest() is implemented. The return value 
> should be HttpRequest instead of HttpSerlvetRequest, then it would be 
> directly clear that this is not the original object anymore... I spent 
> 3 hours now to find out this issue.

I don't remember what was the reason for this implementation. Need to 
have a look at it again.
>
> QUESTION:
> - there is a hardcoded limit of 64000 for an upload. I guess this is 
> 64MB? Because we successfully upload images of 12MB. Shouldn't this 
> value be configurable in Yanel?

sure, also see

http://wyona.com/pipermail/yanel-development/2009-April/003455.html
http://bugzilla.wyona.com/cgi-bin/bugzilla/show_bug.cgi?id=6982

As as start I think we should make it at least configurable within 
conf/yanel.xml, whereas we might
rather want to make it configurable within WEB-INF/web.xml because it 
its web app think and not really
anything to do with Yanel itself.

WDYT?

Thanks

Michael
>
> Cheers and thanks for the hints!
>
> Balz.
>
>
> On Thu, Feb 24, 2011 at 11:24 PM, simon <simon at 333.ch 
> <mailto:simon at 333.ch>> wrote:
>
>     Am 24.02.2011 21:30, schrieb baszero at gmail.com
>     <mailto:baszero at gmail.com>:
>
>         Yes , enctype is set, yanel logs are fine. Have to debug
>         tomorrow, don't understand it ...
>
>     not sure but maybe this could help you:
>
>     http://trac.yanel-contribution.3k3.org/browser/resource-types/imageGallery/src/java/com/litwan/yanel/impl/resources/imagegallery/ImageGalleryCUDResource.java
>     see line 305
>
>     HTH
>     simon
>
>
>
>         _____________________
>         CTO
>         www.zwischengas.com <http://www.zwischengas.com>
>
>         Sent from my iPhone
>         My latest Fotos:
>         http://tinyurl.com/lm2010pics
>
>         On 24.02.2011, at 21:09, Michael
>         Wechner<michael.wechner at wyona.com
>         <mailto:michael.wechner at wyona.com>>  wrote:
>
>             Hi Balz
>
>             On 2/24/11 7:06 PM, Balz Schreier wrote:
>
>                 Hi,
>
>                 does anybody already have implemented a file upload
>                 feature in a resource?
>
>             See for example the "from scratch realm" File menu in
>             order to upload an asset:
>
>             http://127.0.0.1:8080/yanel/from-scratch-realm/en/create-new-page.html?resource-type=http%3A%2F%2Fwww.wyona.org%2Fyanel%2Fresource%2F1.0%3A%3Afile&referer=http%3A%2F%2F127.0.0.1%3A8080%2Fyanel%2Ffrom-scratch-realm%2Fen%2Findex.html%3Fyanel.toolbar%3Don&Next=Next
>             <http://127.0.0.1:8080/yanel/from-scratch-realm/en/create-new-page.html?resource-type=http%3A%2F%2Fwww.wyona.org%2Fyanel%2Fresource%2F1.0%3A%3Afile&referer=http%3A%2F%2F127.0.0.1%3A8080%2Fyanel%2Ffrom-scratch-realm%2Fen%2Findex.html%3Fyanel.toolbar%3Don&Next=Next>
>
>                 I am using this library:
>                 http://commons.apache.org/fileupload/streaming.html
>
>                 as it is already available in Yanel.
>
>                 But when I use the API, it does not find any items.
>                 In the network traffic I see that my form gets
>                 submitted correctly, with all the form fields
>                 including the JPG.
>
>             are you sure you have set
>
>             <form  enctype="multipart/form-data"
>
>             ?
>
>             What do the Yanel log files say?
>
>             HTH
>
>             Michael
>
>
>                 Thanks
>                 Cheers
>                 balz
>
>             -- 
>             Yanel-development mailing list Yanel-development at wyona.com
>             <mailto:Yanel-development at wyona.com>
>             http://lists.wyona.org/cgi-bin/mailman/listinfo/yanel-development
>
>
>     -- 
>     Yanel-development mailing list Yanel-development at wyona.com
>     <mailto:Yanel-development at wyona.com>
>     http://lists.wyona.org/cgi-bin/mailman/listinfo/yanel-development
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wyona.org/pipermail/yanel-development/attachments/20110225/f7e5b59e/attachment.html>


More information about the Yanel-development mailing list