4
버킷의 내부 폴더에 파일을 추가하려면 어떻게해야합니까? 버킷 이름이 user
인 경우 -> 폴더 images/selected/
에 추가하고 싶습니다. 도와주세요.AWS S3 Bucket - AWS SDK를 사용하여 내부 폴더에 파일 추가
버킷의 내부 폴더에 파일을 추가하려면 어떻게해야합니까? 버킷 이름이 user
인 경우 -> 폴더 images/selected/
에 추가하고 싶습니다. 도와주세요.AWS S3 Bucket - AWS SDK를 사용하여 내부 폴더에 파일 추가
이것은 로컬 파일 (localfilename.txt)을 S3에 업로드하고 'folders'(image/selected/s3filename.txt)에 파일을 저장하는 작업입니다.
AmazonCredentials * credentials = [[AmazonCredentials alloc] initWithAccessKey:ACCESS_KEY_ID withSecretKey:SECRET_KEY];
putObjectRequest = [[[S3PutObjectRequest alloc] initWithKey:@"images/selected/s3filename.txt" inBucket:@"user"] autorelease];
[putObjectRequest setFilename:@"localfilename.txt"];
[putObjectRequest setCredentials:credentials];
[[AmazonClientManager s3] putObject:putObjectRequest];
희망이 있습니다. 건배, Trond
나는 그것을 시도 할 것이다 [putObjectRequest setFilename : @ "localfilename.txt"]; 줄을 설명해 주시겠습니까? @ Trond Kristiansen – xydev
@xydev [putObjectRequest setFilename : @ "localfilename.txt"] 명령; 업로드 할 로컬 파일의 이름이나 경로를 설정합니다 (예 : /users/test/localfilename.txt). 원격 파일 이름과 경로는 [[[S3PutObjectRequest alloc] initWithKey : @ "images/selected/s3filename.txt"inBucket : @ "user"] 명령을 통해 설정됩니다. –