|
@@ -163,7 +163,7 @@ static const int httpLogLevel = HTTP_LOG_LEVEL_VERBOSE; // | HTTP_LOG_FLAG_TRACE
|
|
|
[filesStr appendFormat:@"<a href=\"%@\"> %@ </a><br/>",filePath, [filePath lastPathComponent]];
|
|
|
}
|
|
|
NSString* templatePath = [[config documentRoot] stringByAppendingPathComponent:@"upload.html"];
|
|
|
- NSDictionary* replacementDict = [NSDictionary dictionaryWithObject:filesStr forKey:@"MyFiles"];
|
|
|
+ NSDictionary* replacementDict = @{@"MyFiles": filesStr};
|
|
|
// use dynamic file response to apply our links to response template
|
|
|
return [[HTTPDynamicFileResponse alloc] initWithFilePath:templatePath forConnection:self separator:@"%" replacementDictionary:replacementDict];
|
|
|
}
|
|
@@ -204,8 +204,8 @@ static const int httpLogLevel = HTTP_LOG_LEVEL_VERBOSE; // | HTTP_LOG_FLAG_TRACE
|
|
|
// in this sample, we are not interested in parts, other then file parts.
|
|
|
// check content disposition to find out filename
|
|
|
|
|
|
- MultipartMessageHeaderField* disposition = [header.fields objectForKey:@"Content-Disposition"];
|
|
|
- NSString* filename = [[disposition.params objectForKey:@"filename"] lastPathComponent];
|
|
|
+ MultipartMessageHeaderField* disposition = (header.fields)[@"Content-Disposition"];
|
|
|
+ NSString* filename = [(disposition.params)[@"filename"] lastPathComponent];
|
|
|
|
|
|
if ( (nil == filename) || [filename isEqualToString: @""] ) {
|
|
|
// it's either not a file part, or
|