large files Download in Java using FileCopyUtils.copy -


i wrote codes download files sever clients machines:

   bufferedinputstream in = null;                 try {                     in = new bufferedinputstream(new fileinputstream(filenpath));                 } catch (filenotfoundexception e) {                      e.printstacktrace();                 }                 string mimetype = servletcontext.getmimetype(filenpath);                  response.setbuffersize(fsize);                 response.setcontenttype(mimetype);                  response.setheader("content-disposition", "attachment; filename=\""+ filename + "\"");                 response.setcontentlength(fsize);                    try {                     filecopyutils.copy(in, response.getoutputstream());                      in.close();                     response.getoutputstream().flush();                     response.getoutputstream().close();                   } catch (ioexception e) {                      e.printstacktrace();                 } 

this code works fine files smaller 8m not larger files. grateful if guys give me hints.

thanks, nick

there not go on here. in tomcat there various ways set maximum file upload size.

for example in tomcat server.xml, there maxpostsize setting. not know enough server look.


Comments

Popular posts from this blog

Javascript line number mapping -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -