FileSaver on Android gets Stream too long on big files #1554
Replies: 2 comments
-
I see our implementation for Android (https://github.com/CommunityToolkit/Maui/blob/main/src/CommunityToolkit.Maui.Core/Essentials/FileSaver/FileSaverImplementation.android.cs) makes use of streams but does copy everything into memory. This code could be modified to buffer and write chunks rather than the whole contents. Would you mind opening this as a bug and then we can look at getting it fixed? |
Beta Was this translation helpful? Give feedback.
0 replies
-
I have opened a bug report at #1605. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to use FileSaver on Android to read a big file (example is 3.45 GB) from the application directory and write it to a public directory such as Download and am getting a 0 Byte file and an error response that of Stream too long. It looks like the SaveDocument is trying to load the whole thing into a Memory Stream/Byte array, which can't handle something that big. Instead it would need to be chunked up and saved with multiple writes. Could FileSaver be updated to handle files of this size or is there another convenient way to move the file on Android and not run into permission issues trying to write it?
Beta Was this translation helpful? Give feedback.
All reactions