Skip to content

Commit 24d42e2

Browse files
committed
fix: upload docs
1 parent 56104bc commit 24d42e2

File tree

1 file changed

+7
-2
lines changed
  • src/pages/[platform]/build-a-backend/storage/upload-files

1 file changed

+7
-2
lines changed

src/pages/[platform]/build-a-backend/storage/upload-files/index.mdx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,6 @@ Option | Type | Description |
653653
| -- | -- | ----------- |
654654
| getProperties | boolean | Whether to retrieve properties for the uploaded object using theAmplify.Storage.getProperties() after the operation completes. When set to true the returned item will contain additional info such as metadata and content type. |
655655
| useAccelerateEndpoint | boolean | Whether to use accelerate endpoint. <br/><br/> Read more at [Transfer Acceleration](/[platform]/build-a-backend/storage/upload-files/#transfer-acceleration) |
656-
| expectedBucketOwner | string | Optional | The account ID that owns requested bucket. |
657656

658657
Example of `uploadFile` with options:
659658

@@ -1567,7 +1566,11 @@ const result = await uploadData({
15671566
// configure how object is presented
15681567
contentDisposition: "attachment",
15691568
// whether to use accelerate endpoint
1570-
useAccelerateEndpoint: true
1569+
useAccelerateEndpoint: true,
1570+
// The account ID that owns requested bucket
1571+
expectedBucketOwner: '123456789012',
1572+
// Whether to check if an object with the same key already exists before completing the upload
1573+
preventOverwrite: true,
15711574
},
15721575
});
15731576
```
@@ -1579,6 +1582,8 @@ Option | Type | Default | Description |
15791582
| contentDisposition | string || Specifies presentational information for the object. <br/><br/> Read more at [Content-Disposition documentation](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition) |
15801583
| metadata | map\<string\> || A map of metadata to store with the object in S3. <br/><br/> Read more at [S3 metadata documentation](https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingMetadata.html#UserMetadata) |
15811584
| useAccelerateEndpoint | boolean | false | Whether to use accelerate endpoint. <br/><br/> Read more at [Transfer Acceleration](/[platform]/build-a-backend/storage/upload-files/#transfer-acceleration) |
1585+
| expectedBucketOwner | string | - | The account ID that owns requested bucket. |
1586+
| preventOverwrite | boolean | false | Whether to check if an object with the same key already exists before completing the upload. If exists, a `Precondition Failed` error will be thrown |
15821587

15831588
<Callout>
15841589

0 commit comments

Comments
 (0)