mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-06 04:20:33 +00:00
(fix) handle correctly files being uploaded that are bigger than limit
This commit is contained in:
@@ -111,7 +111,17 @@
|
||||
|
||||
request = [context request];
|
||||
rc = [NSMutableDictionary dictionary];
|
||||
data = [[[[[request httpRequest] body] parts] lastObject] body];
|
||||
data = [[request httpRequest] body];
|
||||
|
||||
// We got an exception, that means the file upload limit
|
||||
// has been reached.
|
||||
if ([data isKindOfClass: [NSException class]])
|
||||
{
|
||||
response = [self responseWithStatus: 507];
|
||||
return response;
|
||||
}
|
||||
|
||||
data = [[[data parts] lastObject] body];
|
||||
|
||||
fileContent = [[NSString alloc] initWithData: (NSData *) data
|
||||
encoding: NSUTF8StringEncoding];
|
||||
|
||||
@@ -77,7 +77,17 @@
|
||||
rc = [NSMutableDictionary dictionary];
|
||||
request = [context request];
|
||||
folder = [self clientObject];
|
||||
data = [[[[[request httpRequest] body] parts] lastObject] body];
|
||||
data = [[request httpRequest] body];
|
||||
|
||||
// We got an exception, that means the file upload limit
|
||||
// has been reached.
|
||||
if ([data isKindOfClass: [NSException class]])
|
||||
{
|
||||
response = [self responseWithStatus: 507];
|
||||
return response;
|
||||
}
|
||||
|
||||
data = [[[data parts] lastObject] body];
|
||||
|
||||
fileContent = [[NSString alloc] initWithData: (NSData *) data
|
||||
encoding: NSUTF8StringEncoding];
|
||||
|
||||
Reference in New Issue
Block a user