2 Replies Latest reply on Mar 13, 2010 9:29 AM by Jim Schumm

    file size limit for downloading from a JBoss server?

    Jim Schumm Newbie
      Hello all,

      I'm running an application on JBoss (jboss-4.2.2.GA) which writes files to the server & then emails the user with the URL to download them.

      I've configured the application to write the files to a location outside the JBoss file structure by following http://www.jboss.org/community/wiki/ExternalDirectories.

      I'm running into a problem now however in that some cases the URL delivers a zero size file - even though I can see the file on the server isn't empty.

      I've run some tests - I can download files of size 22MB & 49MB but when I try one of 66MB it  downloads as empty. This seems to imply it's a size issue.

      I'd like to know:

      1) Where any settings may be made in JBoss to control the maximum download size
      2) Where to look for some diagnostics of the problem - I can't see anything about the downloads failing in  <JBOSS HOME>\server\default\log\server.log


      Any help much appreciated.

      Thanks,
      Jim
        • 1. Re: file size limit for downloading from a JBoss server?
          Mike Finn Newbie

          Jim,

          What is failing - the write of the file to the filesystem, or the actual delivery of the file through Tomcat (assuming Tomcat is the means here) to the client? Any sample code you can share? Never heard of a filesize limit.

          Mike

          • 2. Re: file size limit for downloading from a JBoss server?
            Jim Schumm Newbie

            Hi Mike,

             

            Thanks for your question. The problem is now solved. Apologies  - I should have updated the thread but got side-tracked.

             

            It turned out I needed to add a setting to my server.xml file in

             

            jboss\server\default\deploy\jboss-web.deployer

             

            The setting I needed was useSendFile="false" in
            my connector.

             

            The connector now reads

             

            <Connector port="8080" address="${jboss.bind.address}"
            maxThreads="250" maxHttpHeaderSize="8192"
            emptySessionPath="true"
            protocol="org.apache.coyote.http11.Http11NioProtocol"
            enableLookups="false" acceptCount="100"
            connectionTimeout="20000" disableUploadTimeout="true"
            compressableMimeType="text/html,text/css,text/xml,text/plain,application
            /json,text/javascript"
            compressionMinSize="300" compression="on" useSendfile="false" />

             


            Reading this thread
            http://www.mail-archive.com/users@tomcat.apache.org/msg51465.html//www.mail-archive.com/users@tomcat.apache.org/msg51465.html
            it seems that I must have been hitting the limit of my kernel memory.

             

            I think then that setting useSendfile="false" ensures that all files, regardless of size, can be downloaded but that

            files that could have already been downloaded with the default useSendfile="true" may take that little bit longer.

             

            Best wishes,

            Jim