uploaded files should be iterable
See original GitHub issueCurrent upload
implementation sets the target element files
to an object that matches the type definition for FileList. JSDOM and browsers implement FileList extending from Array, allowing them to be iterable (for example, one can perform [...element.files]
). With the current implementation, after performing the upload, the attribute is not iterable.
sandbox with a demonstration: https://codesandbox.io/s/blazing-sunset-l6izw
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:9 (5 by maintainers)
Top Results From Across the Web
CSV List Import Best Practices
Iterable allows you to upload CSV files of subscribers and their user profile fields. It's a great way to create new static lists...
Read more >Not being able to iterate line by line over a uploaded file ...
You problem, based on this.firstfile.split is not a function or its return value is not iterable error, is that you are trying to...
Read more >How to Send a PDF File in Iterable
1. Log into your Digioh account, click on Files, and click on “Upload File” · 2. Click on the PDF you just uploaded...
Read more >Getting 'builtin_function_or_method object is not iterable' ...
[Solved]-Getting 'builtin_function_or_method object is not iterable' on file upload-django · Your model Seekers should rather be named Seeker using the singular, ...
Read more >dcc.Upload... "TypeError: 'float' object is not iterable"
Basically I have two upload buttons that returns stuff back to 2 corresponding ... Traceback (most recent call last): File "/comparison.py", ...
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
At first I was tried to implement function for emulating
FileList
but it’s not possible with currentFileList
implementation injsdom
.Thats because of this line. So I see no clean option to make
files
asFileList
at now. Here is the issue injsdom
we can keep eye on.About iteration I’m not sure although its convenient to use.
FileList
is not marked as iterable in specs. What do you think @kentcdodds about supporting iteration as Chrome and Firefox do but not Edge (there is a proof in comments of this answer)?Hi, @rbusquet! Thanks for describing a problem here.
I’d tried to implement from the start
upload
as aFileList
as close as possible because it cannot be created and a readonly unfortunately. The only way to createFileList
is withDataTransfer
constructor which has no reliable node polyfill as I’ve found.Your case looks common and I will think about how to make it works with another PR.