패키지, 저장소 및 앱 카테고리 검색

패키지 상세v0.6.0

flutter_aws_s3_client

간단하고 공식이 아닌 Dart용 AWS S3 클라이언트입니다. 버킷 내 개체 다운로드 및 목록 조회를 지원합니다.

AndroidiOSmacOSWindowsLinux
30일 다운로드
123
좋아요
35
Pub 점수
100

패키지 설치

flutter pub add flutter_aws_s3_client

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

Flutter 및 Dart용 가볍고 공식이 아닌 AWS S3 클라이언트로, 아마존 S3와의 간단한 상호작용을 가능하게 합니다. 객체 다운로드 및 버킷 내 콘텐츠 목록 조회를 지원하여 S3에서 기본 파일 검색 및 브라우징이 필요한 앱에 유용합니다. 크로스플랫폼 사용을 위해 설계되어 Android, iOS, macOS, Windows, Linux에서 모두 작동합니다. AWS 공식 유지보수는 아니지만, 무거운 종속성 없이 간편한 접근을 제공합니다.

사용 사례

  • S3 버킷에서 파일 다운로드
  • S3 버킷 내 개체 목록 보기
  • Flutter 앱에 S3 스토리지 통합
  • 클라우드 환경에서의 간단한 파일 관리
  • 크로스플랫폼 클라우드 파일 액세스

주요 기능

  • S3 객체 다운로드 지원
  • 버킷에 있는 개체 목록을 표시합니다
  • 경량이며 최소한의 종속성
  • 크로스 플랫폼 호환성
  • 공식 AWS SDK가 필요하지 않습니다

적합한 대상

  • S3 통합을 사용하여 플러터 앱을 개발하는 개발자
  • 기본적인 S3 작업이 필요한 프로젝트
  • AWS S3에서 파일을 검색해야 하는 앱
  • 프로토타입 또는 소규모 클라우드 스토리지 요구 사항
  • 간단한 S3 요구 사항을 가진 비기업용 애플리케이션

고려 사항

  • 공식 AWS SDK 아님
  • 다운로드 및 목록 작업에 제한됨
  • 업로드 또는 고급 S3 기능 없음
  • 인증 처리를 수동으로 수행해야 할 수 있습니다
  • 비중요하거나 실험적인 사용 사례에 가장 적합

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

Pub Package

DEPRECATED

Since there is now an official package for accessing AWS services, I decided to not longer support this package. please migrate to https://github.com/aws-amplify/amplify-flutter / https://pub.dev/packages/amplify_storage_s3/example

flutter_aws_s3_client

Supports downloading objects and listing objects in a bucket.

The heavy lifting was done by Amazon Cognito Identity SDK for Dart, this project contains just convenience methods for common use cases.

if you need more requests, you can use this instead to build what you need. If you implement more methods, feel free to open a pull request.

Usage

Build the client
  const region = "eu-central-1";
  const bucketId = "yourBucketId";
  final AwsS3Client s3client = AwsS3Client(
      region: region,
      host: "s3.$region.amazonaws.com",
      bucketId: bucketId,
      accessKey: "<your access key>",
      secretKey: "<your secret key>");

Get an object
final response = await s3client.getObject("your/object/key"); 
List objects of the bucket
ListBucketResult listBucketResult =
  await s3client.listObjects(prefix: "dir1/dir2/", delimiter: "/");
print(listBucketResult.toString());

If you want to use a custom http client, use the method buildSignedGetParams. This method returns an object containing the URL and the Authorization headers, which can be used to build the request with your preferred http client.

Download a large object to a file without keeping everything in-memory (streaming)

Use the buildSignedGetParams method.

Example code (with ETag support):


Future download(String key, File file, [String etag = null]) async {

  final signedParams = awsS3Client.buildSignedGetParams(key: key);

  final request = await HttpClient().getUrl(signedParams.uri);

  for (final header in (signedParams.headers ?? const {}).entries) {
    request.headers.add(header.key, header.value);
  }
  if(eTag != null){
    request.headers.add(HttpHeaders.ifNoneMatchHeader, eTag);
  }
  final response = response = await request.close();
  if(response.statusCode != HttpStatus.ok){
     //handle error  
  }else{
     return response.pipe(file.openWrite());
  }
}

카테고리

의존성

의존성 목록 5 개

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.