cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Miguel <>
Subject Doubt about file upload in Cocoon 2.2
Date Thu, 06 Jun 2013 11:43:06 GMT

   At present, I work on project based on cocoon 2.2 and I want to use 
file upload option to send an email with cocoon. Documentation of cocoon 
indicates about the parameters:


The last parameter is very interesting because limit the size of files 
to upload the platform, so I think cocoon would be safe if people try 
upload ver big files.

I have checked that the MultipartParser java class manage this upload 
process, but it seems that the file is readed fully although size of 
file is higher than parameter maxsize, ┬┐it is correct this behaviour?

After debugging MultipartParser class, I see the process is:
1) if (oversized) , so if size of file is higher than parameter maxsize, 
then it is created object out = new NullOutputStream();
2) stream of file is readed and put into object out, and variable lenght 
is size of readed content.
3) if (oversized) then it is created object RejectedPart.

I don't understand because read full file if in this case always it's 
created RejectedPart object. it's necesary length variable for 
RejectedPart object?.

if at the begining of process you know content length of file and this 
number is higher of limit then it's better option not read file and 
create RejectedPart object with length = 0, isn't it?. Maybe, I don't 
know source of cocoon fully, and I am wrong.

Anybody can explain me.

View raw message