Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws-s3(-multipart): add new options #112

Merged
merged 4 commits into from
May 2, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/uploader/aws-s3-multipart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -390,4 +390,20 @@ or between `500` and `600`.

</details>

#### `shouldUseMultipart(file, fileSize)`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe fileSize was removed, right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw that after the merge and updated the docs in a follow up pr, thanks.


A function that returns a boolean, or a boolean value. If a function is
provided, the following arguments will be provided:

- `file` - the `UppyFile` object.
- `fileSize` – the number of bytes to upload.

By default, all files are uploaded as multipart. In a future version, all files
with a size ≤ 100 MiB will be uploaded in a single chunk, all files larger than
that as multipart.

#### `getUploadParameters(file)`

See [`@uppy/aws-s3`][]. This option is used only for non-multipart uploads.

[`@uppy/aws-s3`]: /docs/aws-s3
15 changes: 15 additions & 0 deletions docs/uploader/aws-s3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,20 @@ upload as query parameters (`Array`, default: `null`).
- Set this to `null` (the default) to send _all_ metadata fields.
- Set this to an empty array `[]` to not send any fields.

#### `shouldUseMultipart(file, fileSize)`

When provided, this plugin will be swaped with [`@uppy/aws-s3-multipart`][].
arturi marked this conversation as resolved.
Show resolved Hide resolved

A function that returns a boolean, or a boolean value. If a function is
provided, the following arguments will be provided:

- `file` - the `UppyFile` object.
- `fileSize` – the number of bytes to upload.

By default, all files are uploaded as a single chunk. In a future version, all
files with a size ≤ 100 MiB will be uploaded in a single chunk, all files larger
than that as multipart.

#### `getUploadParameters(file)`

:::note
Expand Down Expand Up @@ -448,4 +462,5 @@ uppy.on('upload-success', (file, data) => {
});
```

[`@uppy/aws-s3-multipart`]: /docs/aws-s3-multipart
[companion docs]: /docs/companion