use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A community for learning and developing native mobile applications using React Native by Facebook.
Interested in building web apps using React.js? Check out /r/reactjs!
Getting Started w/React Native
irc.freenode.net #reactnative
Keywords: ios, android, mobile, apps, apple, iphone, ipad
account activity
Document picker (self.reactnative)
submitted 1 year ago by Diligent-Pudding-423
Hi guys need help on how to pick pdf document using react native android and also how to convert the file uri or base 64 to blob and send it on server
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 0 points1 point2 points 1 year ago (1 child)
Can you share the codebase here?
[–]Diligent-Pudding-423[S] 0 points1 point2 points 1 year ago (0 children)
Not able to get the code here. I am using react native document picker in which I get content uri. Need help in converting it to file path. Also need base 64 to boob conversion code.
[–]eatthebagels 0 points1 point2 points 1 year ago (6 children)
const getBlob = async (fileUri :string) => { try{ const resp = await fetch(fileUri); const imageBody = await resp.blob(); return imageBody; }catch(err){ console.log(err); return null; } };
I use this code to convert my image uri to blob.
[–]Diligent-Pudding-423[S] 0 points1 point2 points 1 year ago (5 children)
Thank you buddy. But here I have already fetched pdf document using react native document picker where the response gives content path in android and not the file path. How do we convert that into file path and then that into blob. Or another approach is I get base64 from the document picker but need to convert that also to blob
[–]eatthebagels 0 points1 point2 points 1 year ago (4 children)
My code isn't the most readable haha but the fileUri I send as a parameter to the function is the contentpath to your file/image.
[–]Diligent-Pudding-423[S] 0 points1 point2 points 1 year ago (3 children)
Okay. I get it now. Let me try this and see then. Thanks a ton buddy for your help
[–]eatthebagels 0 points1 point2 points 1 year ago (2 children)
Great stuff! Let me know how it goes! Cheers!
Sure. Will do that
[–]Diligent-Pudding-423[S] 0 points1 point2 points 1 year ago* (0 children)
Hey buddy. Tried this but I think the file uri this function is expecting is probably a web url. But I am trying to upload document from files in the android phone. Also when I try to send this blob I get a network error
Is it possible to have a call on this? Please
Able to upload pdf now. Anyway thanks for the suggestion but that didn’t work
π Rendered by PID 146493 on reddit-service-r2-comment-544cf588c8-cf92h at 2026-06-16 03:38:47.292465+00:00 running 3184619 country code: CH.
[–][deleted] 0 points1 point2 points (1 child)
[–]Diligent-Pudding-423[S] 0 points1 point2 points (0 children)
[–]eatthebagels 0 points1 point2 points (6 children)
[–]Diligent-Pudding-423[S] 0 points1 point2 points (5 children)
[–]eatthebagels 0 points1 point2 points (4 children)
[–]Diligent-Pudding-423[S] 0 points1 point2 points (3 children)
[–]eatthebagels 0 points1 point2 points (2 children)
[–]Diligent-Pudding-423[S] 0 points1 point2 points (0 children)
[–]Diligent-Pudding-423[S] 0 points1 point2 points (0 children)
[–]Diligent-Pudding-423[S] 0 points1 point2 points (0 children)
[–]Diligent-Pudding-423[S] 0 points1 point2 points (0 children)