Parcourir la source

Update README.md

Pierre-Olivier Latour il y a 11 ans
Parent
commit
3f9aef4dd6
1 fichiers modifiés avec 19 ajouts et 1 suppressions
  1. 19 1
      README.md

+ 19 - 1
README.md

@@ -24,7 +24,7 @@ Requirements:
 Hello World
 ===========
 
-This code snippet shows how to implement a custom HTTP server that runs on port 8080 and returns a "Hello World" HTML page to any request — Because GCDWebServer uses GCD blocks to handle requests, no subclassing or delegates are needed:
+This code snippet shows how to implement a custom HTTP server that runs on port 8080 and returns a "Hello World" HTML page to any request — since GCDWebServer uses GCD blocks to handle requests, no subclassing or delegates are needed:
 
 ```objectivec
 #import "GCDWebServer.h"
@@ -55,6 +55,24 @@ int main(int argc, const char* argv[]) {
 }
 ```
 
+Adding File Upload & Download to iOS Apps
+=========================================
+
+GCDWebUploader is a subclass of GCDWebServer that provides an HTML 5 file uploader & downloader. This lets users upload, download and delete files from a directory inside your iOS app's sandbox using their web browser.
+
+Simply instantiate and run a GCDWebUploader instance then visit http://{YOUR-IOS-DEVICE-IP-ADDRESS}/ from your web browser:
+
+```objectivec
+#import "GCDWebUploader.h"
+
+- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions {
+  NSString* documentsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject];
+  GCDWebUploader* webUploader = [[GCDWebUploader alloc] initWithUploadDirectory:documentsPath];
+  [webUploader start];
+  return YES;
+}
+```
+
 Serving a Static Website
 ========================