I'm trying to convert FileSystemFileEntry's into files using the file() method and pushing them to an array, but I'm losing each file's MIME type (and I suspect more). This is causing the browser to not detect these objects as files.
When I log files in an array that haven't been converted with the file() method, we observe: screenshot of console (1)
When I log an array of converted files, we see: screenshot of console(2)
Later on in my code, when I attempt to loop over this array with:
for (const [index, f] of selectedFiles.entries()) {
console.log('run');
}
Or even with a forEach(), nothing happens, and I suspect it's because I'm losing some data in this conversion process. This is causing me to not be able to manipulate this array of converted files. When using files that haven't been converted coming directly from an html input, I don't run into any issues.
Does anyone have any insight on this issue?
[See MDN's docs] (https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileEntry).