React Native + Expo : save pdf/word doc from url and use Linking to Open the file in a different app

10,719

you can use this exaple is based in documentation:

https://snack.expo.io/BkT-AkAvm

Share:
10,719
Bryan Stump
Author by

Bryan Stump

Hello, My name is Bryan and I'm a software enthusiast. I have been developing professionally for over 7 years. Much of my experience is in .NET and C# working for a large software company. 2 years ago I began working for a fast-growing startup to develop in C#, .NET, and React in AWS. I enjoy working in fast-paced collaborative team-oriented environments.

Updated on June 19, 2022

Comments

  • Bryan Stump
    Bryan Stump almost 2 years

    I've been using the default create-react-native-app and would like to continue to do so as long as I can without ejecting.

    The feature I need for the app is to download a file to the app cache using FileSystem.downloadAsync which stores the file to the local cache or temp directory. Next I need to share that file with any program that can open it. For example. if I download a word doc then open the word viewer, or if it's a pdf then open a pdf viewer.

    Is it possible to open an app that can view those files and still use default create-react-native-app?

  • Bryan Stump
    Bryan Stump over 5 years
    Once it's downloaded how can it be opened? The example is pdf but there might be doc as well. I would expect that an open with...would show up and I would pick the app that handles those doc types
  • Enieber
    Enieber over 5 years
    you can use the shared of react-native to open with another app or use a package to read the specific file
  • Learn with Panda
    Learn with Panda almost 4 years
    @Enieber is their any way i can download base64 qr code as a pdf? I generate base 64 qr code but cann't download since it using url!
  • Enieber
    Enieber almost 4 years
    @LearnwithPanda you can use the QR code like URL of pdf and make dowload of pdf.
  • Enieber
    Enieber almost 4 years
    I updated the snack expo to use sdk 38: snack.expo.io/@enieber/pdf