mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-27 04:05:10 +00:00
@uppy/aws-s3-multipart: fix support for non-multipart PUT upload (#4568)
This commit is contained in:
parent
7dcf8c2f36
commit
6ae15f441e
1 changed files with 10 additions and 4 deletions
|
|
@ -223,16 +223,22 @@ class HTTPCommunicationQueue {
|
|||
headers,
|
||||
} = await this.#getUploadParameters(file, { signal }).abortOn(signal)
|
||||
|
||||
const formData = new FormData()
|
||||
Object.entries(fields).forEach(([key, value]) => formData.set(key, value))
|
||||
let body
|
||||
const data = chunk.getData()
|
||||
formData.set('file', data)
|
||||
if (method === 'post') {
|
||||
const formData = new FormData()
|
||||
Object.entries(fields).forEach(([key, value]) => formData.set(key, value))
|
||||
formData.set('file', data)
|
||||
body = formData
|
||||
} else {
|
||||
body = data
|
||||
}
|
||||
|
||||
const { onProgress, onComplete } = chunk
|
||||
|
||||
return this.#uploadPartBytes({
|
||||
signature: { url, headers, method },
|
||||
body: formData,
|
||||
body,
|
||||
size: data.size,
|
||||
onProgress,
|
||||
onComplete,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue