Uploader component does not provide correct type info
See original GitHub issue- I have searched the issues of this repository and believe that this is not a duplicate.
Version
3.3.1
Environment
N/A
Reproduction link
Steps to reproduce
click upload, select a file
What is expected?
console output has originFileObj, is UploadFile!!!
What is actually happening?
console output nop, not a upload file
in Upload component’s typing, it claims beforeUpload
callback will receive a UploadFile
typed object, but in fact we receive a File
object.
Which causes a lot of trouble when using in TypeScript, for now we write a lot of as any as File
type cast just to get a correct type.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
How You Can Fix The Biggest Problem With React File Upload
This step is crucial in view of uploading files because you must set the content type to multipart/form-data, or else it won't run...
Read more >Testcafe - Unable to upload files with input type="url" which is ...
I am trying to upload a file but getting error "The specified selector does not match a file input element", I know testcafe...
Read more >React Uploader API component - Syncfusion
Specifies the extensions of the file types allowed in the uploader ... The uploader component does not allow to interact when this property...
Read more >lightning-file-upload - documentation - Salesforce Developers
A lightning-file-upload component provides an easy and integrated way for users to upload multiple files. You can configure the file uploader to accept ......
Read more >Understanding and Correcting MSDS File Upload Errors
errors in the XML schema are found, the file will not process. ... Error messages that occur after a file upload in MSDS...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The
file
is the “originFileObj”This is not a reason to modify the file type.
beforeUpload
should be return the realFile
for user to control, such like file verification.eg: On
beforeupload
to get image size with usefileReader
/window.URL. createObjectURL(file)
.