mirror of
https://github.com/swisspol/GCDWebServer.git
synced 2026-04-24 00:00:04 +08:00
Fix
This commit is contained in:
+3
-1
@@ -278,7 +278,9 @@ int main(int argc, const char* argv[]) {
|
|||||||
}
|
}
|
||||||
for (GCDWebServerMultiPartFile* file in [(GCDWebServerMultiPartFormRequest*)request files]) {
|
for (GCDWebServerMultiPartFile* file in [(GCDWebServerMultiPartFormRequest*)request files]) {
|
||||||
NSDictionary* attributes = [[NSFileManager defaultManager] attributesOfItemAtPath:file.temporaryPath error:NULL];
|
NSDictionary* attributes = [[NSFileManager defaultManager] attributesOfItemAtPath:file.temporaryPath error:NULL];
|
||||||
[string appendFormat:@"%@ = "%@" (%@ | %llu KB)<br>", file.controlName, file.fileName, file.mimeType, attributes.fileSize / 1000];
|
[string appendFormat:@"%@ = "%@" (%@ | %llu %@)<br>", file.controlName, file.fileName, file.mimeType,
|
||||||
|
attributes.fileSize >= 1000 ? attributes.fileSize / 1000 : attributes.fileSize,
|
||||||
|
attributes.fileSize >= 1000 ? @"KB" : @"Bytes"];
|
||||||
};
|
};
|
||||||
NSString* html = [NSString stringWithFormat:@"<html><body><p>%@</p><hr>%@</body></html>", string, formHTML];
|
NSString* html = [NSString stringWithFormat:@"<html><body><p>%@</p><hr>%@</body></html>", string, formHTML];
|
||||||
return [GCDWebServerDataResponse responseWithHTML:html];
|
return [GCDWebServerDataResponse responseWithHTML:html];
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
HTTP/1.1 200 OK
|
HTTP/1.1 200 OK
|
||||||
Cache-Control: no-cache
|
Cache-Control: no-cache
|
||||||
Content-Length: 443
|
Content-Length: 447
|
||||||
Content-Type: text/html; charset=utf-8
|
Content-Type: text/html; charset=utf-8
|
||||||
Connection: Close
|
Connection: Close
|
||||||
Server: GCDWebServer
|
Server: GCDWebServer
|
||||||
Date: Fri, 25 Apr 2014 14:15:21 GMT
|
Date: Fri, 25 Apr 2014 14:15:21 GMT
|
||||||
|
|
||||||
<html><body><p>secret = 42<br>files = "hero_mba_11.jpg" (image/jpeg | 106 KB)<br>files = "Test File.txt" (text/plain | 0 KB)<br></p><hr> <form name="input" action="/" method="post" enctype="multipart/form-data"> <input type="hidden" name="secret" value="42"> <input type="file" name="files" multiple><br/> <input type="submit" value="Submit"> </form> </body></html>
|
<html><body><p>secret = 42<br>files = "hero_mba_11.jpg" (image/jpeg | 106 KB)<br>files = "Test File.txt" (text/plain | 21 Bytes)<br></p><hr> <form name="input" action="/" method="post" enctype="multipart/form-data"> <input type="hidden" name="secret" value="42"> <input type="file" name="files" multiple><br/> <input type="submit" value="Submit"> </form> </body></html>
|
||||||
Reference in New Issue
Block a user