YouTube の再開可能なアップロードを見ていた
進行状況は、ASIHTTPRequest で 0 から 1 にジャンプします。これが私のコードです:
-(void)uploadVideoFile:(NSDictionary *) params
{
if(_location && _location.length != 0)
{
NSURL *url = [NSURL URLWithString:_location];
ASIFormDataRequest *theRequest = [ASIFormDataRequest requestWithURL:url];
[theRequest setRequestMethod:@"PUT"];
NSString *length = [NSString stringWithFormat:@"%lld",[WSKSharerHelper fileSizeWithPath:_filePath]];
[theRequest addRequestHeader:@"Content-Type" value:@"video/quicktime"];
[theRequest addRequestHeader:@"Content-Length" value:length];
[theRequest appendPostDataFromFile:_filePath];
theRequest.delegate = self;
theRequest.uploadProgressDelegate = self;
theRequest.timeOutSeconds = 100;
[[ASIManager manager] addRequest:theRequest];
[[ASIManager manager] startQueue];
}
}