File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JForum and the fly likes upload files larger than 100Kb Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JForum
Bookmark "upload files larger than 100Kb" Watch "upload files larger than 100Kb" New topic
Author

upload files larger than 100Kb

Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
I have the problem to upload files larger than 100KB.

I am using 2.1.8, and both 'upload' and 'tmp' folders are there. I can upload files less than 100KB, for files larger than 100KB, no error pop-up, just nothing shows up. I don't know if anyone still have this attachment issue. Thanks.
[originally posted on jforum.net by chows@gvmc.org]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Problem solved according to Monroe's suggestion. It is caused by hard coded memory threshold of WebRequestContext.handleMultipart which limits the file size that can be upload. After I have changed it to 1000K, I am able to upload files more than 100KB but less than 1000KB.
Change the value as your limitation in following code (set up 3MB upload limit in the following example):
ServletFileUpload upload = new ServletFileUpload(new DiskFileItemFactory(3000 * 1024, tmpDir));
in WebRequestContext.java
After compiled, copy WebRequestContext.class to \WEB-INF\classes\net\jforum\context\web
[originally posted on jforum.net by chows@gvmc.org]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
One thing to make clear... the "threshold" setting in this is the amount of real physical memory (e.g. RAM/paging space) that will be used while uploading a file. If a file is larger than this threshold, the file will not be stored in memory but in a temporary file on the disk.

So, you may "fix" your problem by storing things in memory, but then have major performance problems because multiple file uploads are using up your memory/paging space.

IMHO, it's better to figure out why the temporary file can't be created.
[originally posted on jforum.net by monroe]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Bonjour,

La solution est simple !
Dans le fichier SystemGlobals.properties remplacer la ligne
tmp.dir = tmp
par la ligne
tmp.dir = ${application.path}/tmp

It works fine !

Marc


[originally posted on jforum.net by Mal1]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: upload files larger than 100Kb