Menu

Trouble uploading large files

Kai Puth
2016-01-25
2016-01-28
  • Kai Puth

    Kai Puth - 2016-01-25

    Hi,

    I am trying to upload one MP4 file that is 36.1 MB large to the server's file system. The upload progess won't go beyond 1 % and no part of the web application will respond. The web server itself keeps responding just fine. And the computer running the server seems to be under heavy load. The corresponding code looks like this:

        @Stereotype("FILE")
        @Column(length=32)
        private String videoPath;
    
        public String getVideoPath() {
            return videoPath;
        }
    
        public void setVideoPath(String videoPath) {
            this.videoPath = videoPath;
        }
    

    This problem does not occure with smaller JPG files.

    Any idea what causes the problem and how to fix it? Thank you.

    Greetings,
    Kai

     
  • Javier Paniza

    Javier Paniza - 2016-01-27

    Hi Kai:

    By default maximum size allowed by Tomcat is 2MB, you can modify this value. Set the maxPostSize attribute value of the HTTP connector in your Tomcat server.xml config file:

    <Connector port="8080" ... maxPostSize="<high_file_size_value>" ...>
    

    Tomcat reference doc: http://tomcat.apache.org/tomcat-7.0-doc/config/http.html#Attributes

    Note that this is not an OpenXava question but one about Tomcat configuration, so you can get more info, and without waiting an answer here, from Tomcat doc, StackOverflow, or just Google. Indeed, I take this answer from StackOverflow.


    Help others in this forum as I help you.

     
  • Kai Puth

    Kai Puth - 2016-01-28

    I'm using Wildfly, but you pointed me in the right direction. Your solution solved my problem. Thank you.

     

Log in to post a comment.