IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Upload files larger than 20MB

  • 1.  Upload files larger than 20MB

    Posted Tue October 19, 2010 02:13 AM

    Hi all,

    I am using FileItem CAF component to upload files via portal page. It is allowing to upload files only upto 20MB :frowning: .

    Is there any way to upload files of size >20MB via portal?


    #MWS-CAF-Task-Engine
    #webMethods-BPMS
    #webMethods


  • 2.  RE: Upload files larger than 20MB

    Posted Tue October 19, 2010 04:14 PM

    MWS has a global max upload size that is managed in the Content Service Admin portlet. By default, this is set to 20MB. Feel free to change this as you need.

    If you want to have more fine grained control on a portlet application by portlet application basis, you can add the following JSF validator to your portlet app. However, no multipart Http POST will get to your code if it is larger than the global max upload file size.

    This code sample limits the uploaded file to be 4MB

    
    /** 
    * Validator to check file size 
    */ 
    public void customFile_validator(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, java.lang.Object value) { 
    if (value instanceof FileItem) { 
    FileItem fileItem = (FileItem)value; 
    
    long maxSize = 4 * 1024000; //4 MB 
    if (maxSize < fileItem.getSize()) { 
    //file is too big, so throw a validator exception 
    throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, 
    "File must be smaller than 4 MB", 
    "File must be smaller than 4 MB")); 
    } 
    } 
    } 

    #webMethods
    #webMethods-BPMS
    #MWS-CAF-Task-Engine


  • 3.  RE: Upload files larger than 20MB

    Posted Wed October 20, 2010 09:59 AM

    hi Mimel,

    Thank you for the reply.
    I set MAX FILE SIZE to 50 MB in Content Service portlet and tried to upload 21 MB size file.

    It gave following exception:

    org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because its size (21620270) exceeds the configured maximum (10485760)

    In web.xml there is one init-param MAX_UPLOAD_DISK_SIZE for filter ‘Multipart Filter’. By default it was set to 10MB. I changed it to 50MB.
    But still the same error is coming.

    Not able to identify where the max upload size was set to 10485760 bytes.

    Could you please let me know if you have any idea?


    #webMethods
    #webMethods-BPMS
    #MWS-CAF-Task-Engine


  • 4.  RE: Upload files larger than 20MB

    Posted Wed October 20, 2010 10:51 PM

    That is 10MB. 1024102410=10485760

    I’ll try to repro this locally, but i’d like you to double check whether you redeployed and/or restarted MWS after making these changes.

    Thanks,
    –mark


    #webMethods
    #MWS-CAF-Task-Engine
    #webMethods-BPMS


  • 5.  RE: Upload files larger than 20MB

    Posted Thu October 21, 2010 04:26 AM

    hi Mark,

    Restarted server deployed the code and checked again, giving the same exception
    org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because its size (21620270) exceeds the configured maximum (10485760)

    I suspect that, in some other configuration file MAX FILE SIZE is set to 10485760 bytes (10MB).

    Thanks,
    Raja sekhar


    #MWS-CAF-Task-Engine
    #webMethods-BPMS
    #webMethods


  • 6.  RE: Upload files larger than 20MB

    Posted Fri October 22, 2010 12:09 AM

    The default size for the Portlet’s Multipart Filter is 10MB. I wasn’t clear at all about where to set the Init Param, so i’ve attached a sample that you can try out and see where the Init Param should be set (look in the web.xml).

    Below is a snippet of the web.xml

    
    <filter>
    <description>
    Handles multipart form POSTs (file uploads); required by FileInput control.</description>
    <filter>Multipart Filter</filter>
    <filter>com.webmethods.caf.faces.servlet.MultipartFilter</filter>
    <init>
    <param>MAX_UPLOAD_DISK_SIZE</param>
    <param>30 MB</param>
    </init>
    </filter>

    LargeFileUploadApp.zip (9.36 KB)


    #MWS-CAF-Task-Engine
    #webMethods
    #webMethods-BPMS


  • 7.  RE: Upload files larger than 20MB

    Posted Thu February 24, 2011 05:17 PM

    Hello Mark.

    I’ve tried to open your project but I was not able to.

    I’m using 7.1.2 Designer.

    I have the same problem as stated before, and after setting those values in the Web.xml we still get the same error “org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException”

    Can you help?


    #webMethods-BPMS
    #webMethods
    #MWS-CAF-Task-Engine


  • 8.  RE: Upload files larger than 20MB

    Posted Thu February 24, 2011 05:41 PM

    Hi Mark.

    I’ve managed to import your project to my Designer, sorry for the last Post.

    In the meantime… I’ve looked at your code and your “Upload File” action button does nothing… and it’s an async button.

    Are you able to upload a file with an async button?


    #webMethods-BPMS
    #MWS-CAF-Task-Engine
    #webMethods


  • 9.  RE: Upload files larger than 20MB

    Posted Sat February 26, 2011 05:45 PM

    Edited

    In 7.x, you’ll need to use a SYNC command Button, but in 8.x you can use an Async command button.

    Let me know if you need anything additional on this topic.
    Regards,
    –mark

    Edited
    Ok, i think the issue is that i’m using 8.x for this sample. I’ll start investigating for 7.x.

    Regards,
    –mark


    #MWS-CAF-Task-Engine
    #webMethods
    #webMethods-BPMS