Streaming a file as it gets recorded?
Streaming a file as it gets recorded?
- Subject: Streaming a file as it gets recorded?
- From: "ben levitt" <email@hidden>
- Date: Fri, 4 Jan 2008 13:57:00 -0800
Sorry my first email went out prematurely...
Anyhoo, I'm trying to stream an audio file up to a server as it gets
recorded, using NSMutableURLRequest and an NSInputStrem. The problem
I'm having is that if I start streaming while the file is still
getting recorded, then I only end up sending the beginning of the
file, and as soon as sending catches up to recording, the transfer
stops.
Is there a nice, simple way to get the file to continue streaming
until it's done being written?
I'm trying to do something like the following.
NSURL *cgiUrl = [NSURL URLWithString: urlStr];
NSMutableURLRequest *postRequest = [NSMutableURLRequest requestWithURL:cgiUrl];
//setting the headers:
[postRequest setHTTPMethod:@"POST"];
[postRequest addValue: @"application/octet-stream" forHTTPHeaderField:
@"Content-Type"];
//adding the body:
fileStream = [[NSInputStream inputStreamWithFileAtPath: recordingFile] retain];
[postRequest setHTTPBodyStream: fileStream];
// Make the request
NSURLConnection *theConnection=[[NSURLConnection alloc]
initWithRequest:postRequest: delegate:self];
Thanks,
Ben
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden