You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Martin Marinschek (JIRA)" <de...@myfaces.apache.org> on 2007/11/28 16:15:43 UTC

[jira] Resolved: (TOMAHAWK-6) MyFaces FileUpload Issues

     [ https://issues.apache.org/jira/browse/TOMAHAWK-6?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Marinschek resolved TOMAHAWK-6.
--------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.1.7-SNAPSHOT
         Assignee: Martin Marinschek

Both issues fixed in latest head.

Thanks to Alexander Jesse for helping me to fix and test this.

regards,

Martin

> MyFaces FileUpload Issues
> -------------------------
>
>                 Key: TOMAHAWK-6
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-6
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: File Upload
>            Reporter: David F
>            Assignee: Martin Marinschek
>             Fix For: 1.1.7-SNAPSHOT
>
>
> Their are two issues:
>  The first issues is MyFaces defines an UploadFile Interface that you access in
> your backing bean. The UploadedFile interface doesn't define a method for deleting the temporary files that Commons File Upload creates on disk. These files will be deleted only when the FileItem instances are garbage collected. The DefaultFileItem class of Commons File Upload has a finalize() method that deletes the temporary file managed by the object that is removed from memory. If the application is uploading large files, we want to delete them right after they are processed, without waiting for garbage collection. To be able to do that, we would have to add a getFileItem() method (in UploadedFileDefaultFileImpl) that should return the FileItem instance, which has a delete() method. In addition, we would also have to add
> this to the UploadFile interface as well.
> The second issue is Their are two filter parameters in Myfaces file upload component:  uploadThresholdSize and uploadMaxFileSize(both are required by the Commons File Upload component) The uploadThresholdSize tells Common File uploads to keep files in memory that are less than this size, and uploadMaxFileSize says to ignore files that take less than this size.If you try to upload a file that is too large, the current version of MyFaces ignores all form data, as if the user submitted an empty form. If  we want to signal the failed upload to the user, we would have to change the source code of the MultipartRequestWrapper class of MyFaces and add a FacesContext.getCurrentInstance().addMessage() to warn the user.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Resolved: (TOMAHAWK-6) MyFaces FileUpload Issues

Posted by "Senior Consultants Inc." <se...@gmail.com>.
TOMAHAWK-6 Issue  is not completely resolved.
Problem: I am still not getting a Faces-Message about File Size Exceeded
Environment: JDK 1.5 and IBM WAS 6.1 (Using RAD 7.0 IDE)

I  tried using Tomahawk 1.1.7 release and wanted to see if I upload a
40MB file, I should see a "File Size exceeded" message in the Faces
Context. The Extension filter that I have set is  has 20MB in the
init-param:

<init-param>
    <param-name>uploadMaxFileSize</param-name>
    <param-value>20m</param-value>
</init-param>

Should I report this as a bug in JIRA?

Thank you,
Jay



On 11/28/07, Martin Marinschek (JIRA) <de...@myfaces.apache.org> wrote:
>
>     [ https://issues.apache.org/jira/browse/TOMAHAWK-6?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
>
> Martin Marinschek resolved TOMAHAWK-6.
> --------------------------------------
>
>       Resolution: Fixed
>    Fix Version/s: 1.1.7-SNAPSHOT
>         Assignee: Martin Marinschek
>
> Both issues fixed in latest head.
>
> Thanks to Alexander Jesse for helping me to fix and test this.
>
> regards,
>
> Martin
>
> > MyFaces FileUpload Issues
> > -------------------------
> >
> >                 Key: TOMAHAWK-6
> >                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-6
> >             Project: MyFaces Tomahawk
> >          Issue Type: Bug
> >          Components: File Upload
> >            Reporter: David F
> >            Assignee: Martin Marinschek
> >             Fix For: 1.1.7-SNAPSHOT
> >
> >
> > Their are two issues:
> >  The first issues is MyFaces defines an UploadFile Interface that you access in
> > your backing bean. The UploadedFile interface doesn't define a method for deleting the temporary files that Commons File Upload creates on disk. These files will be deleted only when the FileItem instances are garbage collected. The DefaultFileItem class of Commons File Upload has a finalize() method that deletes the temporary file managed by the object that is removed from memory. If the application is uploading large files, we want to delete them right after they are processed, without waiting for garbage collection. To be able to do that, we would have to add a getFileItem() method (in UploadedFileDefaultFileImpl) that should return the FileItem instance, which has a delete() method. In addition, we would also have to add
> > this to the UploadFile interface as well.
> > The second issue is Their are two filter parameters in Myfaces file upload component:  uploadThresholdSize and uploadMaxFileSize(both are required by the Commons File Upload component) The uploadThresholdSize tells Common File uploads to keep files in memory that are less than this size, and uploadMaxFileSize says to ignore files that take less than this size.If you try to upload a file that is too large, the current version of MyFaces ignores all form data, as if the user submitted an empty form. If  we want to signal the failed upload to the user, we would have to change the source code of the MultipartRequestWrapper class of MyFaces and add a FacesContext.getCurrentInstance().addMessage() to warn the user.
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>