Skip to content

Commit

Permalink
fix: upload file
Browse files Browse the repository at this point in the history
  • Loading branch information
richardmichel committed May 24, 2023
1 parent 8423726 commit 8a78794
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/components/FileUploadS3Multipart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export interface FileUploadS3MultipartProps {
errorCallback: (values: any) => void | undefined;
progressCallback?: (values: any) => void | undefined;
initCallback?: (values: any) => void | undefined;
initPreUploadCallback?: (values: any) => void | undefined;
style?: any;
placeHolder?: string;
setSelectedFile?: (values: any) => void | null | undefined;
Expand Down Expand Up @@ -60,6 +61,7 @@ const FileUploadS3Multipart: React.FC<FileUploadS3MultipartProps> =
uploadedCallback,
progressCallback,
initCallback,
initPreUploadCallback,
showModalUploading = false,
},
ref: any
Expand Down Expand Up @@ -428,6 +430,17 @@ const FileUploadS3Multipart: React.FC<FileUploadS3MultipartProps> =
return;
}

if (initPreUploadCallback) {
const blobUrl = (
window.URL || window.webkitURL
).createObjectURL(myFile);

initPreUploadCallback({
blobUrl,
...myFile
});
}

addFile(myFile);
} catch (errors) {
setDetailProgress(() => {
Expand Down

0 comments on commit 8a78794

Please sign in to comment.