2012-08-07 4 views
0

간단한 파일을 업로드하려고합니다. 파일 업로드시 예기치 않은 동작이 발생합니다.동영상 파일을 업로드하는 동안 iPhone ASIHTTP 오류가 발생했습니다.

iMac에서 iPhone으로 빌드를 실행할 때 문제없이 잘 작동합니다. 하지만 빌드 (ipa) 파일을 만들 때. iTune에서 설치하십시오. 요청이 실패합니다.

ASIHTTP에 문제가있을 수 있습니까?

+0

앱에서 적절한 메모리 관리를 확인해야합니다. –

+0

당신이 이것에 나와 공유하고 싶은 어떤 링크라도? –

답변

0

다음 코드에서 아이디어를 얻을 수 있습니다.

-(IBAction)btnPostData_Clicked: (id)sender 
{ 
    NSString *file2 = [[NSBundle mainBundle] pathForResource:@"Ovation-Mike_Koenig-1061486511" ofType:@"mp3"]; 

    NSData *file1Data = [[NSData alloc] initWithContentsOfFile:file2]; 

    NSURL *audiourl = [NSURL URLWithString:@"http://alligator.netsmartz.us/iphone/iphone.php"]; 

    ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:audiourl]; 

    NSData *postData = [[NSData alloc] initWithContentsOfFile:file2]; 

    //SoundPath is your audio url path of NSDocumentDirectory. 
    [request addData:postData withFileName:@"Ovation-Mike_Koenig-1061486511.mp3" andContentType:@"audio/mp3" forKey:@"company_audio"]; 

    [request setDelegate:self]; 

    [request startSynchronous]; 
} 
+0

Luke와 MSB에게 감사하지만 문제는 내 클라이언트와 공유 할 빌드 (ipa)를 만들 때입니다. 그것의 작동을 멈 춥니 다. ASIHTTP lib 파일에 문제가있을 수 있습니다. XCODE 4.3을 사용하고 있습니다. –

+0

ipa를 구축 할 때 설정하는 배포 대상은 무엇입니까? –

+0

장치 : iPhone 및 배포 대상 : 4.0 –

관련 문제