diff --git a/Mac/main.m b/Mac/main.m index bd8d7c2..4af3a78 100644 --- a/Mac/main.m +++ b/Mac/main.m @@ -278,7 +278,9 @@ int main(int argc, const char* argv[]) { } for (GCDWebServerMultiPartFile* file in [(GCDWebServerMultiPartFormRequest*)request files]) { NSDictionary* attributes = [[NSFileManager defaultManager] attributesOfItemAtPath:file.temporaryPath error:NULL]; - [string appendFormat:@"%@ = "%@" (%@ | %llu KB)
", file.controlName, file.fileName, file.mimeType, attributes.fileSize / 1000]; + [string appendFormat:@"%@ = "%@" (%@ | %llu %@)
", file.controlName, file.fileName, file.mimeType, + attributes.fileSize >= 1000 ? attributes.fileSize / 1000 : attributes.fileSize, + attributes.fileSize >= 1000 ? @"KB" : @"Bytes"]; }; NSString* html = [NSString stringWithFormat:@"

%@


%@", string, formHTML]; return [GCDWebServerDataResponse responseWithHTML:html]; diff --git a/Tests/HTMLFileUpload/002-200.response b/Tests/HTMLFileUpload/002-200.response index be24ad1..a3ec365 100644 --- a/Tests/HTMLFileUpload/002-200.response +++ b/Tests/HTMLFileUpload/002-200.response @@ -1,9 +1,9 @@ HTTP/1.1 200 OK Cache-Control: no-cache -Content-Length: 443 +Content-Length: 447 Content-Type: text/html; charset=utf-8 Connection: Close Server: GCDWebServer Date: Fri, 25 Apr 2014 14:15:21 GMT -

secret = 42
files = "hero_mba_11.jpg" (image/jpeg | 106 KB)
files = "Test File.txt" (text/plain | 0 KB)



\ No newline at end of file +

secret = 42
files = "hero_mba_11.jpg" (image/jpeg | 106 KB)
files = "Test File.txt" (text/plain | 21 Bytes)



\ No newline at end of file