Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<pre><code> - (void)uploadAudio:(NSString *)audioPath jobId:(NSString *)jobIdStr{ FMResultSet *results = [database executeQuery:@"select * from AUDIOS where AUDIOLOC = ? and areqsync = 0 ",audioPath]; if(![results next]) { NSLog(@"Audio already uploaded"); } else{ NSLog(@"Audio is to be uploaded"); NSURL *audiourl=[NSURL URLWithString:audioPath]; NSLog(@"audio url and path are %@ --- %@",audiourl,audioPath); NSData *audioData=[NSData dataWithContentsOfFile:audiourl.path]; @try { NSLog(@"In upload audio function"); NSString *strURL = @"http://abc.com/data/default.aspx"; ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:strURL]]; request= [request initWithURL:[NSURL URLWithString:strURL]]; [request setShouldContinueWhenAppEntersBackground:YES]; [request setShouldAttemptPersistentConnection:YES]; [request setPostValue:jobIdStr forKey:@"lbljid"]; [request setPostValue:@"2" forKey:@"lblMtype"]; [request setPostValue:[Settings UserName] forKey:@"lblUsername"]; [request setPostValue:[Settings Password] forKey:@"lblpassword"]; [request addData:audioData withFileName:@"audio.caf" andContentType:@"audio/x-caf" forKey:@"filMyFile"]; [request setCompletionBlock:^{ BOOL success = [database executeUpdate:@"UPDATE AUDIOS SET areqsync = '1' WHERE AUDIOLOC = ?",audioPath ]; NSLog(success ? @"Audio Update to syncronised Yes" : @"Update to ended No"); [self requestFinished:request]; }]; //if request failed [request setFailedBlock:^{ [self requestFailed:request]; NSLog(@"request Failed: %@",[request error]); }]; [request startAsynchronous]; uploadCount++; } @catch (NSException *exception) { NSLog(@"Exception name and reson is %@ ------- %@",exception.name, exception.reason); } @finally { NSLog(@"finalyy of upload audio"); } }//end of if audio already sync } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload