Skip to content
Open
Changes from all commits
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
7 changes: 6 additions & 1 deletion src/Dropzone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -496,12 +496,17 @@ class Dropzone extends React.Component<IDropzoneProps, { active: boolean; dragge

uploadFile = async (fileWithMeta: IFileWithMeta) => {
const { getUploadParams } = this.props

if (!getUploadParams) return
let params: IUploadParams | null = null
try {
params = await getUploadParams(fileWithMeta)
} catch (e) {
console.error('Error Upload Params', e.stack)
if(e instanceof Error) {
console.error('Error Upload Params', e.stack)
} else {
console.error('Cannot get params out of getUploadParams due to promise error')
}
}
if (params === null) return
const { url, method = 'POST', body, fields = {}, headers = {}, meta: extraMeta = {} } = params
Expand Down