-
-
Notifications
You must be signed in to change notification settings - Fork 464
[Android][Google Drive] Download file from google drive then cache in local storage #264
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
Conversation
|
It should be documented and download should be optional with a flag that's documented as well |
|
@Elyx0 I added a flag |
|
Any updates? I can't send an audio file to the server! |
|
@vonovak can this be merged? |
|
@vonovak I tested this on my application. This is a great fix, and a wonderful job, thanks! Working with it in fileprovider is much more logical. And I would really like to be added to the master as quickly as possible. Can we do it ? |
|
hello folks. Thanks for this PR. I have to say I'm not in favor of merging such functionality into the module. I believe it'll be better if this module does one thing, and one thing only - and that is picking files and returning their uris and other info. Once we start mixing in other functionality, like this one, it'll become much(!) more complicated, bugs will surface (one was already found in the post above!), and guess what - people will want them to be fixed. Working with uris on android is a PITA especially given the plethora of places the files can come from, ranging from local drives to remote files, also considering the android fragmentation. iOS has its corner cases too, at least from my experience with background uploads. The maintenance of this module is already a demanding task: 70+ issues that no one has time to fully address. IMO we should focus on the task of picking files and doing it right. What consumers do with those files is another thing and while I agree it'd be nice to include extra functionality into this module, I'm worried it'll lower its quality and become a maintenance issue. Speaking for this particular use case - I use this module and I have custom handling of returned uris in a background service (and I think many users will want to have it customized). I hope this makes sense, feel free to discuss further. |
|
@vonovak I agree with trying to keep things simple and functional. Unless, I'm mistaken without this PR there is no way to use document-picker and get an actual path to the file on Android. I'm specifically talking about the "if I don't have any comments on the "download remote file" functionality, but getting that file path is what's important to me. |
|
@vonovak |
|
I believe the correct way forward would be to fix Blob support in react native core react-native-community/discussions-and-proposals#109 |
|
@JerakRus Just fixed the problem with |
|
@vonovak Any chance to get this PR merged? Basically, this just provide users a way to get local file path. Users can ignore this prop if they don't want to. |
|
hi! yes, I now agree we should merge something like this into the repo as you suggested. I guess if you fix the merge conflicts then we can give it a review and merge |
android/src/main/java/io/github/elyx0/reactnativedocumentpicker/DocumentPickerModule.java
Outdated
Show resolved
Hide resolved
android/src/main/java/io/github/elyx0/reactnativedocumentpicker/DocumentPickerModule.java
Outdated
Show resolved
Hide resolved
android/src/main/java/io/github/elyx0/reactnativedocumentpicker/DocumentPickerModule.java
Outdated
Show resolved
Hide resolved
android/src/main/java/io/github/elyx0/reactnativedocumentpicker/PathResolver.java
Outdated
Show resolved
Hide resolved
android/src/main/java/io/github/elyx0/reactnativedocumentpicker/PathResolver.java
Outdated
Show resolved
Hide resolved
|
@vonovak just merge to master to resolve conflict and get base branch to continue. I am working to update with |
|
@vonovak I've done implementation. Please help to review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi! thanks a lot for working on this! I only left some minor comments / suggestion, can you please take a look? Thanks!
android/src/main/java/io/github/elyx0/reactnativedocumentpicker/DocumentPickerModule.java
Show resolved
Hide resolved
android/src/main/java/io/github/elyx0/reactnativedocumentpicker/DocumentPickerModule.java
Outdated
Show resolved
Hide resolved
|
The way I see it for v4 is that we'd split into @rndp/essentials or @rndp/core and then add some addons after like @rndp/downloaders @rndp/theme. We'd have much more chance of making the ecosystem thrive on it while keeping specialized sub-scopes for community plugins. |
|
Hi @vonovak , I updated the code. Please help review the changes. Thanks |
|
@r0b0t3d thanks so much for this. Tested with android 6 and 10 devices, merging |
* upstream/master: (22 commits) 5.0.2 fix: copyTo on android to put the file in a uniquely named dir (react-native-documents#397) 5.0.1 Fix copyFile on Android. (react-native-documents#392) chore: document RN blob support 5.0.0 support only android >=5 (API 21) (react-native-documents#386) [Android][Google Drive] Download file from google drive then cache in local storage (react-native-documents#264) 4.3.0 [Windows] Implementing Folder Picker support (react-native-documents#380) Fix crash on iOS (react-native-documents#383) chore: deleted duplicate test case (react-native-documents#375) chore: change readme wording 4.2.0 iOS : add mode option (react-native-documents#345) chore: update comment for closing issues (react-native-documents#373) chore: update discussions in readme (react-native-documents#372) chore: introduce GH discussions (react-native-documents#371) chore: add issue actions (react-native-documents#369) chore: update provided file type shortcuts ...
|
still happening same issue |

Fix #206 #250
PathResolveris copied fromrn-fetch-blob.I modified a bit to allow download file if cannot get from
content resolver.With this PR,
FIELD_URIwill be the real file path.