Skip to content
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

saveAs is not implemented on web yet #130

Open
ekuleshov opened this issue Dec 8, 2024 · 0 comments
Open

saveAs is not implemented on web yet #130

ekuleshov opened this issue Dec 8, 2024 · 0 comments

Comments

@ekuleshov
Copy link

Please add basic implementation for saveAs method on the web platform.
It could be the same call to FileSaverWeb.downloadFile(fileModel) as in the saveFile method.

On a side note, I wonder what are the benefits of using JS classes to assemble the data url string?

You could do it directly in Dart like Uri.dataFromBytes(fileModel.bytes, mimeType: fileModel.mimeType).toString().toJS

String url = URL.createObjectURL(
Blob(
<JSUint8Array>[fileModel.bytes.toJS].toJS,
BlobPropertyBag(type: fileModel.mimeType),
),
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant