Class RequestMultipartHelper


  • public final class RequestMultipartHelper
    extends Object
    • Field Detail

      • MAX_REQUEST_SIZE

        public static final long MAX_REQUEST_SIZE
        The maximum size of a single file (in bytes) that will be handled. May not be larger than 2 GB as browsers cannot handle more than 2GB. See e.g. http://www.motobit.com/help/ScptUtl/pa33.htm or https://bugzilla.mozilla.org/show_bug.cgi?id=215450 Extensive analysis: here
        See Also:
        Constant Field Values
    • Method Detail

      • handleMultipartFormData

        @Nonnull
        public static com.helger.commons.state.EChange handleMultipartFormData​(@Nonnull
                                                                               jakarta.servlet.http.HttpServletRequest aHttpRequest,
                                                                               @Nonnull
                                                                               BiConsumer<String,​Object> aConsumer)
        Parse the provided servlet request as multipart, if the Content-Type starts with multipart/form-data.
        Parameters:
        aHttpRequest - Source HTTP request from which multipart/form-data (aka file uploads) should be extracted.
        aConsumer - A consumer that takes either IFileItem or IFileItem[] or String or String[].
        Returns:
        EChange.CHANGED if something was added