Skip to content
Snippets Groups Projects
Commit befc8465 authored by xuty's avatar xuty
Browse files

finish presignedPutObject

parent 1f9594da
No related merge requests found
...@@ -5,8 +5,8 @@ This is the _unofficial_ MinIO Dart Client SDK that provides simple APIs to acce ...@@ -5,8 +5,8 @@ This is the _unofficial_ MinIO Dart Client SDK that provides simple APIs to acce
| Bucket operations | Object operations | Presigned operations | Bucket Policy & Notification operations | | Bucket operations | Object operations | Presigned operations | Bucket Policy & Notification operations |
|-------------------------|-------------------------|-----------------------|-------------------------------------------| |-------------------------|-------------------------|-----------------------|-------------------------------------------|
| [makeBucket] | [getObject] | [presignedUrl] | getBucketNotification | | [makeBucket] | [getObject] | [presignedUrl] | getBucketNotification |
| [listBuckets] | [getPartialObject] | presignedGetObject | setBucketNotification | | [listBuckets] | [getPartialObject] | [presignedGetObject] | setBucketNotification |
| [bucketExists] | [fGetObject] | presignedPutObject | removeAllBucketNotification | | [bucketExists] | [fGetObject] | [presignedPutObject] | removeAllBucketNotification |
| [removeBucket] | [putObject] | presignedPostPolicy | getBucketPolicy | | [removeBucket] | [putObject] | presignedPostPolicy | getBucketPolicy |
| [listObjects] | [fPutObject] | | setBucketPolicy | | [listObjects] | [fPutObject] | | setBucketPolicy |
| [listObjectsV2] | [copyObject] | | listenBucketNotification | | [listObjectsV2] | [copyObject] | | listenBucketNotification |
...@@ -93,4 +93,6 @@ MIT ...@@ -93,4 +93,6 @@ MIT
[fPutObject]: https://pub.dev/documentation/minio/latest/io/MinioX/fPutObject.html [fPutObject]: https://pub.dev/documentation/minio/latest/io/MinioX/fPutObject.html
[presignedUrl]: https://pub.dev/documentation/minio/latest/minio/Minio/presignedUrl.html [presignedUrl]: https://pub.dev/documentation/minio/latest/minio/Minio/presignedUrl.html
[presignedGetObject]: https://pub.dev/documentation/minio/latest/minio/Minio/presignedGetObject.html
[presignedPutObject]: https://pub.dev/documentation/minio/latest/minio/Minio/presignedPutObject.html
...@@ -641,6 +641,22 @@ class Minio { ...@@ -641,6 +641,22 @@ class Minio {
); );
} }
/// Generate a presigned URL for PUT.
/// Using this URL, the browser can upload to S3 only with the specified object name.
///
/// - [bucketName]: name of the bucket
/// - [objectName]: name of the object
/// - [expires]: expiry in seconds (optional, default 7 days)
Future<String> presignedPutObject(
String bucket,
String object, {
int expires,
}) {
MinioInvalidBucketNameError.check(bucket);
MinioInvalidObjectNameError.check(object);
return presignedUrl('PUT', bucket, object, expires: expires);
}
/// Generate a generic presigned URL which can be /// Generate a generic presigned URL which can be
/// used for HTTP methods GET, PUT, HEAD and DELETE /// used for HTTP methods GET, PUT, HEAD and DELETE
/// ///
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment