Open viv3kk opened 5 years ago
Respone when we use download manager
respInfo:
headers:
accept-ranges: "bytes"
cache-control: "public, max-age=31536000"
cf-cache-status: "HIT"
cf-ray: "46b1c2a30f1b8aaf-BOM"
content-length: "606640"
content-type: "image/jpeg"
date: "Wed, 17 Oct 2018 09:32:51 GMT"
expect-ct: "max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct""
expires: "Thu, 17 Oct 2019 09:32:51 GMT"
last-modified: "Fri, 05 Oct 2018 2:21:52 GMT"
server: "cloudflare"
set-cookie: "__cfduid=db7793343e709a7e22de59e602d00a6b21539768771; expires=Thu, 17-Oct-19 09:32:51 GMT; path=/; domain=.pexels.com; HttpOnly"
vary: "Accept-Encoding"
x-cache: "HIT, MISS"
x-content-type-options: "nosniff"
x-served-by: "cache-lax8625-LAX, cache-bom18225-BOM"
__proto__: Object
redirects: Array(1)
0: "https://images.pexels.com/photos/570987/pexels-photo-570987.jpeg"
length: 1
__proto__: Array(0)
respType: ""
rnfbEncode: "path"
state: "2"
status: 200
taskId: "tyaaued2h7826b0kfna1m"
timeout: false
I got the same problem did you solve this ?
in my case i change my dir from .config({ // response data will be saved to this path if it has access right. path : '/data/0/user/{packageName}/file/{imageName}.jpg' })
to .config({ // response data will be saved to this path if it has access right. path : '/storage/emulated/0/{appName}/{imageName}.jpg' })
and, it works.
if you have a better solution please tell me
no did not solve this... will try ur solution
Make sure to check you have the write external storage permission for android, I left this out and everything appeared to work correctly accept file wouldn't show up
Got the same problem, how did you do to locate the file?
(I've actived the WRITE_EXTERNAL_STORAGE permission)
I'm facing the same issue but only in iOS device using RNFetchBlob.fs.dirs.DocumentDir
as path. The fetch response comes with the correct path but after download i got no file.
EDIT:
i've solved this by using WRITE_EXTERNAL_STORAGE
permission on Android.
And using this keys in info.plist for iOS:
<key> UIFileSharingEnabled</key>
<true/>
<key>LSSupportsOpeningDocumentsInPlace</key>
<true/>
As described here, to enable file sharing in the app Document folder.
I was faced same issue, but it solved. Simple solution that worked was
I'm facing the same issue but only in iOS device using
RNFetchBlob.fs.dirs.DocumentDir
as path. The fetch response comes with the correct path but after download i got no file.EDIT: i've solved this by using
WRITE_EXTERNAL_STORAGE
permission on Android. And using this keys in info.plist for iOS:<key> UIFileSharingEnabled</key> <true/> <key>LSSupportsOpeningDocumentsInPlace</key> <true/>
As described here, to enable file sharing in the app Document folder.
After downloading a pdf file using RNFetchBlob, I can see the document exists in RNFetchBlob.fs.dirs.DocumentDir. But, I can not see the file in files app in iOS. It's working fine for Android though.
That happened to me... I solved by adding the fix mentioned above, but I also created a new folder inside RNFetchBlob.fs.dirs.DocumentDir
to store my PDF files. Don't know if this will help you but you can try.
@vitorverasm o comando WRITE_EXTERNAL_STORAGE eu colocaria aonde no projeto android? E tem diferença entre colocar ele e ativar manualmente o armazenamento?
@RaphaPetrere vc tem q incluir essa permissão no arquivo android/app/src/main/AndroidManifest.xml
:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
É importante colocar a definição do uso da permissão no manifest, ao fazer isso o app ja identifica que precisa dessa permissão e vc não tem que ativar manualmente.
I'm facing the same issue but only in iOS device using
RNFetchBlob.fs.dirs.DocumentDir
as path. The fetch response comes with the correct path but after download i got no file. EDIT: i've solved this by usingWRITE_EXTERNAL_STORAGE
permission on Android. And using this keys in info.plist for iOS:<key> UIFileSharingEnabled</key> <true/> <key>LSSupportsOpeningDocumentsInPlace</key> <true/>
As described here, to enable file sharing in the app Document folder.
After downloading a pdf file using RNFetchBlob, I can see the document exists in RNFetchBlob.fs.dirs.DocumentDir. But, I can not see the file in files app in iOS. It's working fine for Android though.
I also facing same problem, By chance find any solution?
I also facing same problem, By chance find any solution?
Try upgrading this package to latest. I had that issue while using DownloadsManager
where I was using some previous version than latest.
console.log('The file saved to ', res.path()) returns /data/user/0/com.myapp/files/RNFetchBlobTmp_x34fi32dgqgwbthcfrdc8e
I have also used download manager and specific path but unable to loacte file. When i am using download manager, I also get a notification but no image.
React native : 0.56 Mutliple Physical devices used