I am uploading a video to server with post method. but there is problem that it is not received by server.
her my code for posting a video.
NSString *post=[NSString stringWithFormat:@"domain=%@,key=%@,email=%@,password=%@,category=%@,sub_category=%@,title=%@,photoimg-videos=%@,keywords=%@,language=%@,country=%@",domain,key,emailgetinvid,passgetinvid,category,btn_ctgry.currentTitle,txt_bobltag.text,videopathget,txt_description.text,btn_lang.currentTitle,btn_cntry.currentTitle];
NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
NSString *postLength = [NSString stringWithFormat:@"%lu", (unsigned long)[post length]];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"my url"]cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:20.0];
NSString *boundary = @"---------------------------14737809831466499882746641449";
NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@",boundary];
[request setHTTPMethod:@"POST"];
[request addValue:contentType forHTTPHeaderField: @"Content-Type"];
[request setValue:postLength forHTTPHeaderField:@"Content-Length"];
[request setHTTPBody:postData];
this code is not working for me. i am getting that video from image picker and convert it to url.
convert that video in fileurl is good or not or it should be in data?
give me solution code.