Apache commons file upload alternatives
Asked Answered
Y

2

20

I was wondering what Java File Upload API's StackOverflow users have used in the past and would recommend using? A quick Google Search seems to indicate that the most commonly used API is Apache Commons File Upload (currently at 1.2.1), however, we've had some issues regarding the use of this library with larger files that we've been unable to solve.

Has anyone found a reliable file upload library (aside from the Apache Commons one) that they'd recommend?

EDIT: The Streaming API is not an option as it uses the same underlying class that is causing our issue.

EDIT2: Our original issue appears to be some kind of problem with load balancing. Our clone instance uses Apache/AJP1.3 and the live instance uses Zeus XTM. Bypassing the load balancer by using the server IP rather than host name seems to cause the problem to disappear.

EDIT3: This turned out to be an issue with the clients firewall. It appears that they were.. er.. not being entirely truthful when they said that the knew definitely this was not a Firewall issue.

Yetac answered 6/8, 2010 at 9:58 Comment(6)
What sort of problems? memory related?Untouchability
The files that cause the problems are 7MB and over. The largest we've tested with is 600MB. What happens is that the upload fails in the browser, and we end up with a stack trace in the logs which states that the stream ended unexpectedly. There is an open bug related to this on the Commons File Upload JIRA instance (issues.apache.org/jira/browse/FILEUPLOAD-143). The last but one commenter is myself. It's not a Flash issue, this is happening across browsers, but only for Windows XP and Vista clients. We are utterly baffled.Yetac
There was another StackOverflow question I asked regarding this issue (#3264309) but nobody seemed to know the answer.Yetac
The MultipartStream documentation says that if the underlying input stream fails to follow the required syntax (RFC 1867) it throws this particular error (MalformedStreamException). But that can't be because you are using browsers. Have you tried another version or a nightly?Untouchability
Well, we've tried downgrading to earlier versions, and that hasn't worked. But we haven't tried a nightly build as yet - it is one of the remaining things we can try, I guess.Yetac
If you are looking for the nightly builds they are available from the snapshot repository: repository.apache.org/content/groups/snapshots/…Tizes
U
1

If you have time or memory related problems, have you looked at the streaming API of commons file upload?

Untouchability answered 6/8, 2010 at 10:4 Comment(1)
Yes. We've looked at the source and found that it uses the class we're having issues with - org.apache.commons.fileupload.MultipartStream.Yetac
A
-2

have a look at theese settings, the limit is 8MB by default

upload_max_filesize
post_max_size
Atharvaveda answered 6/8, 2010 at 13:55 Comment(2)
Where are these settings? In commons file upload itself? I had a quick Google and they appear to be Apache settings. We're not using Apache..Yetac
In the docs (commons.apache.org/fileupload/using.html) it says that you can set a Max upload size for an upload by doing upload.setSizeMax(yourMaxRequestSize); - but the default for this value is -1, which is no limit.Yetac

© 2022 - 2024 — McMap. All rights reserved.