(fix) handle correctly files being uploaded that are bigger than limit

This commit is contained in:
Ludovic Marcotte committed 2016-05-02 11:48:37 -04:00
1 parent ed15e13100
commit 3212e978b3
2 files changed
+22 -2

No files matched your search

+11 -1
View File
@@ -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];