iphone - Uploading image or a video to server as a raw data without encoding -
is possible upload media(image & video ) directly server without encoding picking using uiimagepickercontroller, if please suggest me how it.please provide sample this.
in case of video upload can send file without encoding on server here code that:
if ([type isequaltostring:(nsstring *)kuttypevideo] || [type isequaltostring:(nsstring *)kuttypemovie]) { nsurl *urlvideo = [info objectforkey:uiimagepickercontrollermediaurl]; } //in urlvideo path of media file(video files) nsstring *str = [nsstring stringwithformat:@"%@/uploadvideo.php",appurl]; nsurl *url =[nsurl urlwithstring:[str stringbyaddingpercentescapesusingencoding:nsutf8stringencoding]]; asiformdatarequest *request = [asiformdatarequest requestwithurl:url]; [request setpostvalue:self.gameid forkey:@"gameid"];//value gameid parameter [request setfile:strurl forkey:@"uploadfile"]; //setfile method used upload video files [request setrequestmethod:@"post"]; [request setdelegate:self]; [request startsynchronous]; nslog(@"responsestatuscode %i",[request responsestatuscode]); nslog(@"responsestatuscode %@",[request responsestring]);
i hope might please remember not work in case of image upload
Comments
Post a Comment