functionland / react-native-fula

React (JS/Native) wrapper for go-fula/mobile which creates a bridge between Fula and WNFS for React Native to enable developers create mobile native apps
MIT License
2 stars 5 forks source link

Unable to get a file and store to a specific path #10

Closed ghorbani-m closed 1 year ago

ghorbani-m commented 2 years ago

Get an error to receive a file with file path parameter:

file.receive("[cid]", false,"[FilePath]")

Error:

[Error: open /data/user/0/land.fx.fotos/files/fula/received////storage/emulated/0/Android/media/com.whatsapp/WhatsApp/Media/WhatsApp Images/IMG-20220525-WA0038.jpg: no such file or directory]
farhoud commented 2 years ago

I does not intended to.

https://github.com/functionland/react-native-fula/blob/f573128f05442cc9afea66270cefa6a66c2438bb/android/src/main/java/land/fx/FulaModule.java#L43.

Because of permission we decide to use internal storage to store photo and then if you needed you can move them.

farhoud commented 2 years ago

@ghorbani-m you can only override fileName not the path that it store it. export const receive = async (fileId: string, include64:boolean,fileName?: string)

ghorbani-m commented 2 years ago

Ah my bad, the parameter name is fileName, But I think it would be better if the developer could determine the full path. If someone needs to set an external storage path, he should first handle the storage permission and then receive a file from the box.

ehsan6sha commented 1 year ago

changed this to wnfs