-
-
Notifications
You must be signed in to change notification settings - Fork 464
Closed
Description
Hello! I am not good at English, so I write with the help of a translator. I ask for your understanding 😂
Feature request
In the case of a file larger than 2GB on Android, size is a negative value as a result of DocumentPicker.pick (It works fine on iOS)
Why it is needed
There is a part that selects a file and processes it using the size of the file. It does not work properly when selecting a file larger than 2GB on Android.
Possible implementation
In getMetadata() of DocumentPickerModule.java, FIELD_SIZE is being treated as int. Changing this to treat it as double works fine.
Code sample
Current code
private WritableMap getMetadata(Uri uri) {
// ...
if (!cursor.isNull(sizeIndex)) {
map.putInt(FIELD_SIZE, cursor.getInt(sizeIndex)); // <-- this line!
} else {
map.putNull(FIELD_SIZE);
}
// ...
}New code
private WritableMap getMetadata(Uri uri) {
// ...
if (!cursor.isNull(sizeIndex)) {
map.putDouble(FIELD_SIZE, cursor.getDouble(sizeIndex)); // treat as 'double' 🤗
} else {
map.putNull(FIELD_SIZE);
}
// ...
}Metadata
Metadata
Assignees
Labels
No labels