You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On which framework/platform are you having an issue?
React
Which UI component?
Storage
How is your app built?
Vite
What browsers are you seeing the problem on?
Firefox
Which region are you seeing the problem in?
No response
Please describe your bug.
FileUploader does not upload modified file content as described in documentation.
For example, in the following code snippet, file content is replaced entirely but FileUploader still uploads the original input file.
constprocessFile: FileUploaderProps['processFile']=async({ file })=>{constfileExtension=file.name.split('.').pop();consttext="This is the content of my file";constblob=newBlob([text],{type: "text/plain"});constprocessedFile=newFile([blob],`${file.name}.txt`,{type: "text/plain"});returnprocessedFile.arrayBuffer().then((filebuffer)=>window.crypto.subtle.digest('SHA-1',filebuffer)).then((hashBuffer)=>{consthashArray=Array.from(newUint8Array(hashBuffer));consthashHex=hashArray.map((a)=>a.toString(16).padStart(2,'0')).join('');return{file: processedFile,key: `${hashHex}.txt`};});};exportfunctionFileUploaderExample(){return(<FileUploaderacceptedFileTypes={['image/*']}path={({identityId})=> `private/${identityId}/`}maxFileCount={3}showThumbnails={true}processFile={processFile}/>);}
If the now deprecated accessLevel is used instead of path as below, then the processed file content will be uploaded as expected.
choyky
changed the title
FileUploader does not upload processed file contents in certain scenarios
Bug (Storage/FileUploader): FileUploader does not upload processed file contents in certain scenarios
Nov 11, 2024
Hi @choyky thanks for filing this bug and for the proposed solution! I was able to replicate your bug in the latest version. I will bring up your PR with the team.
Before creating a new issue, please confirm:
On which framework/platform are you having an issue?
React
Which UI component?
Storage
How is your app built?
Vite
What browsers are you seeing the problem on?
Firefox
Which region are you seeing the problem in?
No response
Please describe your bug.
FileUploader does not upload modified file content as described in documentation.
For example, in the following code snippet, file content is replaced entirely but FileUploader still uploads the original input file.
If the now deprecated
accessLevel
is used instead ofpath
as below, then the processed file content will be uploaded as expected.What's the expected behaviour?
FileUploader uploads processed/modified file contents instead of the original input.
Help us reproduce the bug!
You could use above example code to reproduce the bug. Check the file contents on S3 and verify that it is the same as original input.
Code Snippet
See above.
Console log output
No response
Additional information and screenshots
No response
The text was updated successfully, but these errors were encountered: