Josias Thöny wrote:
On Thu, 2006-06-15 at 10:31 +0200, Oliver Schalch wrote:
Hi List,

At the moment there is *no* message which gives the user a hint why a upload didnt happen. If you try uploading an image and enable.upload is false it just returns to the screen you was.

2 Suggestion:

--- before a user will try to upload ---
We add a check to all place where its possible to upload files which checks the l.b.p (b.p) and add an according message there if enable.upload=false

or

--- after a user tried to upload ---
We just check if the upload didnt happen and inform the user about this and why it could happen.

I'm not sure if there is a nice way we could check the enable.upload paramater in the local.build.properties direct from the usecase. If that doesent work in a nice way, we should just check if the file was uploaded, if not add a information about the enable.upload.

Unfortunately the usecase cannot check if the upload has worked or not. The reason is that request-parameters in the body of the request are
ignored by Cocoon for multipart/form-data requests (which are used for
uploading files) if uploads are disabled. (Technical background see
below [*])
As a consequence, the continuation-id is lost and the usecase doesn't
continue.

First I thought we could put the continuation-id for the upload usecases
into the URL (index.html?lenya.continuation=1234).
But the submit parameter is lost also, so it doesn't help. The whole
usecase-processing doesn't work :(

Mhh :(


I guess we have to check l.b.p and display a warning on the screen where
the user selects the file to upload.

Yes, I like that idea anyway, in 99% it will fail because of the enable.upload=false in lbp. I will have a look at it, how I could get stuff out the local.b.p inside a usecase.

Or we enable file-upload by default.

Uploading files could be a part of a CMS, so why not. But that its more a workaround to get rid of the discussion above ;). And probably some security reason to not set uploads=true by default.

Oliver



- Josias

[*]
The servlet API provides the method getParameter(String name) to access
request parameters, but this method doesn't work for in-body request
parameters of multipart/form-data requests.
Cocoon (and other web-application frameworks) now wrap the
HttpServletRequest into another class (MultipartHttpServletRequest)
which allows to access all request parameters.
Now if uploads are disabled, this wrapping doesn't happen, therefore the
request-parameters in the body are not accessible with the
getParameter() method.



Other Ideas?


Greets,
Oli






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Oliver Schalch                           [EMAIL PROTECTED]
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com                      http://lenya.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to