Skip to content

Commit

Permalink
Merge branch 'darkv-big_uploads'
Browse files Browse the repository at this point in the history
  • Loading branch information
rkiddy committed May 6, 2014
2 parents e31e947 + 2f64aa6 commit a5ffd1f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public WOResponse handleRequest(WORequest request) {
String uploadIdentifier = null;
String uploadFileName = null;
InputStream uploadInputStream = null;
int streamLength = -1;
long streamLength = -1L;

try {
String sessionIdKey = WOApplication.application().sessionIdKey();
Expand Down Expand Up @@ -114,7 +114,7 @@ else if (formData.isFileUpload()) {
}

try {
if (_maxUploadSize >= 0 && streamLength > _maxUploadSize) {
if (_maxUploadSize >= 0L && streamLength > _maxUploadSize) {
IOException e = new IOException("You attempted to upload a file larger than the maximum allowed size of " + new ERXUnitAwareDecimalFormat(ERXUnitAwareDecimalFormat.BYTE).format(_maxUploadSize) + ".");
progress.setFailure(e);
progress.dispose();
Expand Down
14 changes: 12 additions & 2 deletions Frameworks/Ajax/Ajax/Sources/er/ajax/AjaxProgress.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,31 @@ public class AjaxProgress {
*
* @param maximum the maximum value of this progress
*/
public AjaxProgress(int maximum) {
public AjaxProgress(long maximum) {
this("AjaxProgress" + System.currentTimeMillis(), maximum);
}

@Deprecated
public AjaxProgress(int maximum) {
this((long) maximum);
}

/**
* Construct an AjaxProgress
*
* @param id the id of this AjaxProgress (only useful if you're registering it with AjaxProgressBar's registry)
* @param maximum the maximum value of this progress
*/
public AjaxProgress(String id, int maximum) {
public AjaxProgress(String id, long maximum) {
_id = id;
_maximum = maximum;
}

@Deprecated
public AjaxProgress(String id, int maximum) {
this(id, (long) maximum);
}

/**
* Returns the id of this progress model.
*
Expand Down
9 changes: 7 additions & 2 deletions Frameworks/Ajax/Ajax/Sources/er/ajax/AjaxUploadProgress.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,17 @@ public static interface Delegate {
* @param fileName the name of the file uploaded from the client
* @param streamLength the total length of the stream
*/
public AjaxUploadProgress(String id, File tempFile, String fileName, int streamLength) {
public AjaxUploadProgress(String id, File tempFile, String fileName, long streamLength) {
super(id, streamLength);
_tempFile = tempFile;
_fileName = fileName;
}


@Deprecated
public AjaxUploadProgress(String id, File tempFile, String fileName, int streamLength) {
this(id, tempFile, fileName, (long) streamLength);
}

/**
* Returns the name of the file the client uploaded.
*
Expand Down

2 comments on commit a5ffd1f

@rkiddy
Copy link
Member Author

@rkiddy rkiddy commented on a5ffd1f May 6, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought that these commits would show up as being from darkv. I will have to see why this was not so. Sorry for any confusion.

@darkv
Copy link
Member

@darkv darkv commented on a5ffd1f Jun 10, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably you used the squash command from git that merges a complete branch into one new single commit regardless of how many commits were in the branch, making it your own commit? Apart from that these changes are not very exciting anyway ;)

Please sign in to comment.