cordova-plugin-file
cordova-plugin-file copied to clipboard
android big file 60mb writeFile error
Bug Report
Problem
android big file 60mb writeFile error ios not problem perfect working
What is expected to happen?
not write error problem
What's the DOMException
that is cut off in the screenshot?
Code block for ionic 4
https://ionicframework.com/docs/native/file
What's the
DOMException
that is cut off in the screenshot?
That doesn't answer my question.
Inside the web inspector, I see that the FileReader
object (event.target
) has an error
property. That error
property has a DOMException
. But the full error text is cut off. We need to know what that DOMException
is.
i understand sorry
Hmm, the error is kinda strange.
I think usually you see that if:
- The directory you're writing to does not exists
- Lack permissions to write to the directory
But it looks like you're trying to write to the application storage directory and I think apps implicitly have permission to that directory, and it looks like you're writing to the root data directory, and that should automatically exists.
Are you able to provide a sample test app that demonstrates this issue? Please only include the core cordova libraries (ie no frameworks like ionic). You can learn how to create a sample app here.
Hmm, the error is kinda strange.
I think usually you see that if:
- The directory you're writing to does not exists
- Lack permissions to write to the directory
But it looks like you're trying to write to the application storage directory and I think apps implicitly have permission to that directory, and it looks like you're writing to the root data directory, and that should automatically exists.
Are you able to provide a sample test app that demonstrates this issue? Please only include the core cordova libraries (ie no frameworks like ionic). You can learn how to create a sample app here.
4-5 mb below easily writes our problem is not to write large files and errors
i found an article about this but i can't apply it to my project :(
https://www.reddit.com/r/cordova/comments/7qwfxo/need_help_readingwriting_large_files_100mb/dxagj63/
4-5 mb below easily writes our problem is not to write large files and errors
Hmm, in my apps I frequently write large amounts of data, on average 10-20mb, but I've seen datasets over 100mb. One difference between my app and your app is I write JSON data as a string. It looks like you're writing a blob. These data types could be handled differently. Another important difference is I'm not using the ionic framework.
This is where a pure cordova sample project becomes useful. To eliminate the possibility that the problematic code is outside of Cordova's control, and to also pinpoint exactly what the problem is.
If the problem is specifcally writing large files, we can quickly generate a large file by using the fsutil file createnew output.dat 60000000
command on windows (requires the administrator console).
Or on linux: dd if=/dev/zero of=output.dat bs=60M count=1
Or on mac: dd if=/dev/zero of=output.dat bs=1m count=60
4-5 mb below easily writes our problem is not to write large files and errors
Hmm, in my apps I frequently write large amounts of data, on average 10-20mb, but I've seen datasets over 100mb. One difference between my app and your app is I write JSON data as a string. It looks like you're writing a blob. These data types could be handled differently. Another important difference is I'm not using the ionic framework.
This is where a pure cordova sample project becomes useful. To eliminate the possibility that the problematic code is outside of Cordova's control, and to also pinpoint exactly what the problem is.
If the problem is specifcally writing large files, we can quickly generate a large file by using the
fsutil file createnew output.dat 60000000
command on windows (requires the administrator console).Or on linux:
dd if=/dev/zero of=output.dat bs=60M count=1
Or on mac:
dd if=/dev/zero of=output.dat bs=1m count=60
My information is quite insufficient. Could you offer me a solution for ionic?
Could you offer me a solution for ionic?
No, if you're looking for ionic-specific support, a better place to ask is through ionic's support channels. Most of our cordova maintainer's have much knowledge about third-party frameworks like ionic to give proper answers, and even if they did, the Cordova channels are not the right place for ionic questions or bug reporting.
This is why I'm asking a reproduction app without the use of frameworks. This serves a few different purposes:
- It provides us a provable scenario of a problem in Cordova, and eliminates any possibility that the problem is being caused by third-party code.
- It can also be used to test solutions, to determine if a bug fix actually indeed fixes the problem.
I have a similar problem on iOS when writing file of 90Mb. Webview restart whithout any error trace before end of writing. Using https://gist.github.com/M3psipax/027ca0df737800163f54a771862c1310 (with arraybuffer instead blob) fix the error for me