I'm writing a web application and the application OS X, which will upload files to the server.
The web application uses FlowJS to handle sending files to the server. Along with each request it sends the chunk was number, block size, total file size, file name, etc. It's great, because behind the scenes I load the data into the S3, and I use this information to determine when the file is complete. Moreover, since the data comes in pieces, I do not need to store the entire file into memory on my server.
For OS X with an objective c I plan to use AFNetworking. I tried to use a multi-boot:
-(void)uploadFileWithUrl:(NSURL*)filePath { AFHTTPRequestOperationManager*manager = [AFHTTPRequestOperationManager manager]; [manager POST:@"http://www.example.com/files/upload" parameters:nil constructingBodyWithBlock:^(id<AFMultipartFormData> formData) { [formData appendPartWithFileURL:filePath name:@"blob" error:nil]; } success:^(AFHTTPRequestOperation *operation, id responseObject) { NSLog(@"Success: %@", responseObject); } failure:^(AFHTTPRequestOperation *operation, NSError *error) { NSLog(@"Error: %@", error); }]; }
but it's just trying to send the entire file into a single request, which is unacceptable, as the large queries will be no memory.
I would like to know if something like FlowJS there for the C object, or if there is some way to include this information in AFNetworking for each call.
eliot source share