[Yanel-dev] Upload a file

Balz Schreier balz.schreier at gmail.com
Fri Feb 25 08:47:16 CET 2011


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.

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?

Cheers and thanks for the hints!

Balz.


On Thu, Feb 24, 2011 at 11:24 PM, simon <simon at 333.ch> wrote:

> Am 24.02.2011 21:30, schrieb 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
>>
>> 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>
>>  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
>>>
>>>> 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
>>> http://lists.wyona.org/cgi-bin/mailman/listinfo/yanel-development
>>>
>>
> --
> Yanel-development mailing list 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/2ebc40d8/attachment.html>


More information about the Yanel-development mailing list