This question already has an answer here:
I am recording video from the ipad app and i want that video may be saved in documents folder or directly we may upload that to server.I have store audio file in documents but how to save a video file.I am using following code for recording video.
Thanks.
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
{
NSArray *mediaTypes = [NSArray arrayWithObject:(NSString*)kUTTypeMovie];
picker.mediaTypes = mediaTypes ;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
picker.cameraCaptureMode = UIImagePickerControllerCameraCaptureModeVideo ;
[self presentModalViewController:picker animated:NO];
[picker release];
}
else
{
UIAlertView *alt=[[UIAlertView alloc]initWithTitle:@"Error" message:@" Camera Facility is not available with this Device" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
[alt show];
[alt release];
}
Once try like this,
now define your method to upload vedio like,
now implement ASIFormDataRequest delegatemethods like,
Here i took ASIFormDataRequest to upload on to server.hope it will hepls you..
for saving into Document folder & it also save in photo Library
Try this, I've stored it with current Date-Time ::
Video Uploading ::
videoData
is getting fromvideoData = [[NSData dataWithContentsOfURL:videoURL] retain];
Hope, it'll help you.
Thanks.