developer tip

S3 및 AWS 콘솔을 사용하여 하위 폴더가있는 폴더 업로드

optionbox 2020. 11. 29. 10:13
반응형

S3 및 AWS 콘솔을 사용하여 하위 폴더가있는 폴더 업로드


AWS 콘솔을 통해 하위 폴더가있는 폴더를 S3에 업로드하려고하면 하위 폴더가 아닌 파일 만 업로드됩니다.

폴더를 선택할 수도 없습니다. 무엇이든 선택하기 전에 항상 폴더를 먼저 열어야합니다.

이것이 가능할까요?


Enhanced Uploader (더 이상 존재하지 않는다고 생각) 또는 타사 소프트웨어 (항상 누군가가 S3 버킷 또는 모든 AWS 리소스에서 개인 데이터 또는 액세스 키를 훔칠 위험이 있음)가 필요하지 않습니다.

새로운 AWS S3 웹 업로드 관리자 지원은 이후 drag'n'drop 파일에 대한 폴더 바로 로그인을, https://console.aws.amazon.com/s3/home 과에서 평소 그럼 그냥 드래그 폴더와 업로드 프로세스를 시작하여 데스크톱을 S3 페이지로 직접 연결합니다. 민감한 개인 데이터를 업로드하는 경우 작업중인 페이지가 https : // 프로토콜로 시작하는지 확인하십시오.


AWS CLI를 사용하는 것이 좋습니다. 명령 줄과 awscli를 사용하는 것은 매우 쉽습니다.

    aws s3 cp SOURCE_DIR s3://DEST_BUCKET/ --recursive

또는 다음으로 동기화를 사용할 수 있습니다.

    aws s3 sync SOURCE_DIR s3://DEST_BUCKET/

aws cli를 설치하고 액세스 키 ID 및 보안 액세스 키 ID를 사용하여 구성해야합니다.

     pip install --upgrade --user awscli   
     aws configure

이제 Amazon S3 콘솔은 전체 폴더 계층 업로드를 지원합니다. 업로드 대화 상자에서 Ehanced Uploader를 활성화 한 다음 하나 이상의 폴더를 업로드 대기열에 추가합니다.

http://console.aws.amazon.com/s3


일반적으로 저는 AWS 관리 콘솔을 통해 제공 되는 Enhanced Uploader를 사용합니다 . 그러나 Java가 필요하기 때문에 문제가 발생할 수 있습니다. s3cmd 가 훌륭한 명령 줄 대체품이라는 것을 알았습니다 . 사용 방법은 다음과 같습니다.

s3cmd --configure   # enter access keys, enable HTTPS, etc.
s3cmd sync <path-to-folder> s3://<path-to-s3-bucket>/

S3에서 폴더 및 하위 폴더를 업로드하기위한 향상된 업 로더 도구를 찾는 데 문제가있었습니다. 그러나 도구를 찾는 대신 S3 버킷에 끌어다 놓기 만하면 폴더와 하위 폴더를 함께 업로드 할 수 있습니다.

참고 :이 드래그 앤 드롭 기능 은 Safari에서 작동하지 않습니다 . Chrome에서 테스트했으며 잘 작동합니다.

끌어서 놓기

파일과 폴더를 드래그 앤 드롭하면 마지막으로이 화면이 열리고 콘텐츠를 업로드 할 수 있습니다.

여기에 이미지 설명 입력


It's worth mentioning that if you are simply using S3 for backups, you should just zip the folder and then upload that. This Will save you upload time and costs.

If you are not sure how to do efficient zipping from the terminal have a look here for OSX.

And $ zip -r archive_name.zip folder_to_compress for Windows. Alternatively a client such as 7-Zip would be sufficient for Windows users


I do not see Python answers here. You can script folder upload using Python/boto3. Here's how to recursively get all file names from directory tree:

def recursive_glob(treeroot, extention):
    results = [os.path.join(dirpath, f)
        for dirpath, dirnames, files in os.walk(treeroot)
        for f in files if f.endswith(extention)]
    return results

Here's how to upload a file to S3 using Python/boto:

k = Key(bucket)
k.key = s3_key_name
k.set_contents_from_file(file_handle, cb=progress, num_cb=20, reduced_redundancy=use_rr )

I used these ideas to write Directory-Uploader-For-S3


I ended up here when trying to figure this out. With the version that's up there right now you can drag and drop a folder into it and it works, even though it doesn't allow you to select a folder when you open the upload dialogue.


You can drag and drop those folders. Drag and drop functionality is supported only for the Chrome and Firefox browsers. Please refer this link https://docs.aws.amazon.com/AmazonS3/latest/user-guide/upload-objects.html


You can use Transfer Manager to upload multiple files, directories etc More info on:

https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/examples-s3-transfermanager.html


끌어서 놓거나 가리키고 클릭하여 파일을 업로드 할 수 있습니다. 폴더를 업로드하려면 드래그 앤 드롭해야합니다. 드래그 앤 드롭 기능은 Chrome 및 Firefox 브라우저에서만 지원됩니다.


CloudBerry Explorer 프리웨어사용하여 전체 폴더 구조를 Amazon S3에 업로드하는 것이 좋습니다.


온라인 도구를 통해 이와 같은 중첩 구조를 업로드 할 수 없습니다. 더 복잡한 업로드에는 Bucket Explorer 와 같은 것을 사용하는 것이 좋습니다 .

참고 URL : https://stackoverflow.com/questions/5123208/upload-folder-with-subfolders-using-s3-and-the-aws-console

반응형