Skip to content
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

upload files in the app doesn't work.... #334

Open
5 tasks done
bangs5282 opened this issue Dec 15, 2024 · 1 comment
Open
5 tasks done

upload files in the app doesn't work.... #334

bangs5282 opened this issue Dec 15, 2024 · 1 comment

Comments

@bangs5282
Copy link

bangs5282 commented Dec 15, 2024

Summary

(I'm sorry my English skills are not good.)
I looked at the example and made the code exactly as it was. But it doesn't work.


let result = await DocumentPicker.getDocumentAsync({
type:'*/*',
copyToCacheDirectory: false,
});

//const uri = FileSystem.documentDirectory+result.assets[0].name;
setSrc(result.assets[0].uri);


I think setSrc(result.assets[0].uri); is not correct.
What should I do?
(uri returns content://com.android.externalstorage.documents/document/primary%3ADownload%2Ffailing-forward%20(1).epub)

thank you for your response.

What platform(s) does this occur on?

Android

What workflow(s) does this occur on?

Expo Workflow, Bare Workflow

Environment (or package.json)


{
  "name": "epubreader-app",
  "version": "1.0.0",
  "main": "index.js",
  "scripts": {
    "start": "expo start --dev-client",
    "android": "expo run:android",
    "ios": "expo run:ios",
    "web": "expo start --web"
  },
  "dependencies": {
    "@epubjs-react-native/core": "^1.4.6",
    "@epubjs-react-native/expo-file-system": "^1.1.3",
    "@epubjs-react-native/file-system": "^1.1.3",
    "epubjs": "^0.3.93",
    "expo": "~52.0.18",
    "expo-document-picker": "^13.0.1",
    "expo-file-system": "~18.0.5",
    "expo-status-bar": "~2.0.0",
    "invariant": "^2.2.4",
    "react": "18.3.1",
    "react-native": "0.76.5",
    "react-native-config": "^1.5.3",
    "react-native-document-picker": "^9.3.1",
    "react-native-fs": "^2.20.0",
    "react-native-gesture-handler": "~2.20.2",
    "react-native-send-intent": "^1.3.0",
    "react-native-webview": "13.12.5",
    "react-native-zip": "^1.0.0",
    "react-native-zip-archive": "^7.0.1"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0"
  },
  "private": true
}

Your .epub file

any

Minimal reproducible example

No response

I confirm that i have

  • I looked for a solution to my problem in other open and resolved issues
  • I checked the examples provided solve my problem
  • I have verified that my problem is not caused by a third-party library
  • I cloned the project environment examples and still the problem persists
  • I'm using the latest available version of the library and its complements
@bangs5282
Copy link
Author

I find solution...

In android,
RNFS.DownloadDirectoryPath + "/" + result.assets[0].name
should be src

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant