내 응용 프로그램에 dropbox 지원이 추가되었으며, 모든 것이 완벽하게 작동합니다. 인증, 로그인/아웃이 가능하지만 파일을 업로드 할 수 없습니다. 나는 드롭 박스 내 응용 프로그램/문서 디렉토리를 업로드 할 Dropbox API iOS가 파일을 업로드하지 않습니다.
NSArray *p = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString* docDir = [p objectAtIndex:0];
NSString *localPath = docDir;
NSString *filename = @"Documents";
NSString *destDir = @"/";
[[self restClient] uploadFile:filename toPath:destDir
withParentRev:nil fromPath:localPath];
를 사용하고, 그러나 아무것도 업로드되지 않습니다. 오류 메시지가 표시되지 않습니다. Apps/My-Applications-Name 디렉토리가 생성되었지만 내용이 없습니다.
누구나 알 수 있습니까?
이 두 가지 대리자 메서드도 있지만 로그는 아직 가져 오지 않습니다. 또한 <DBRestClientDelegate>
@interface …()
뒤에서 있습니다 Documents
디렉토리이지만, uploadFile
가 파일을 업로드하는 데 사용됩니다 같은
- (void)restClient:(DBRestClient*)client uploadedFile:(NSString*)destPath
from:(NSString*)srcPath metadata:(DBMetadata*)metadata {
NSLog(@"File uploaded successfully to path: %@", metadata.path);
}
- (void)restClient:(DBRestClient*)client uploadFileFailedWithError:(NSError*)error {
NSLog(@"File upload failed with error - %@", error);
}
폴더를 업로드 할 수 없으며 특정 파일 만 업로드 할 수 있습니다. 그리고 지정한 파일은 파일 이름이 아닌 전체 파일 경로 여야합니다. – rmaddy
그래서 파일 이름은 Path입니까? –
죄송합니다, 나는'fromPath' 인자가 완전한 경로명이어야한다는 것을 의미했습니다. 제 첫 번째 의견의 두 번째 절반을 무시할 수있을 것 같습니다. – rmaddy