-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
result of chooseEntry is not correct #245
Comments
after more research on that i have follow the chrome sample example here and it seams they cast an Entry to a FileEntry and when i did the same in dart i have : NoSuchMethodError on the .slice() chrome.ChooseEntryOptions chooseEntryOptions =
new chrome.ChooseEntryOptions(type: chrome.ChooseEntryType.OPEN_FILE);
chrome.ChooseEntryResult chooseEntryResult =
await chrome.fileSystem.chooseEntry(chooseEntryOptions);
Entry entry = chooseEntryResult.entry;
print(entry.isFile); // print true
print(entry.name);
Metadata meta = await chooseEntryResult.entry.getMetadata();
print(meta.size);
FileEntry fileEntry = (entry as FileEntry);
File file = await fileEntry.file();
Blob blob = file.slice(); // trig a NoSuchMethodError here |
Wanted to update you that I haven't forgotten this issue, just in the middle of a very busy new year :) I hope to have time to address mid feb. |
I was also having issues with chooseEntry. I looked into it, and I'm fairly certain it's a bug in the original JavaScript implementation. I ran the following in the console. chrome.fileSystem.chooseEntry(function(a,b){console.log(a);console.log(b);});
// Returns a FileEntry for a, and undefined for b.
chrome.fileSystem.chooseEntry({acceptsMultiple: true},
function(a,b){console.log(a);console.log(b);});
// Returns an array of FileEntry for a, and undefined for b.
chrome.fileSystem.chooseEntry({acceptsMultiple: false},
function(a,b){console.log(a);console.log(b);});
// This also allows selection of multiple files, and is the same as the previous. Also, I looked into the NoSuchMethodError. In src/files.dart File isn't implemented, so the underlying JsObject is cast to a File from dart:html. However, as far as I can tell the File from dart:html no longer implements JsObject so it doesn't work. |
Hi,
when i use chooseEntry it return a ChooseEntryResult object but the fileEntries value of this object is always null.
If you have an idea, thanks.
The text was updated successfully, but these errors were encountered: