Comments (20)
Hi @mMarcos208 I think the issue is with package version, I also stumbled on the same error. So, I downgraded the version to [email protected]
it works for me. Hope it helps.
from react-native-blob-util.
Comment the two line(273, 274) in fetch.js
fs.session(options.session).add(data);
}
respInfo.rnfbEncode = rawType;
- if ('uninit' in respInfo && respInfo.uninit) // event didn't fire yet so we override it here
- respInfo = responseInfo;
+ // if ('uninit' in respInfo && respInfo.uninit) // event didn't fire yet so we override it here
+ // respInfo = responseInfo;
resolve(new FetchBlobResponse(taskId, respInfo, data));
}
from react-native-blob-util.
Hi @mMarcos208, I have fixed this issue by wrapping the path with path: ReactNativeBlobUtil.wrap(filePath)
`
import {Platform} from 'react-native'
import ReactNativeBlobUtil, {ReactNativeBlobUtilConfig} from 'react-native-blob-util'
export const options = (name: string, extension = 'pdf', notification = true) => {
const {fs} = ReactNativeBlobUtil
const {
dirs: {DocumentDir, DownloadDir},
} = fs
return Platform.select({
ios: {
fileCache: true,
path: ReactNativeBlobUtil.wrap(${DocumentDir}/${name}
),
title: name,
},
android: {
fileCache: true,
addAndroidDownloads: {
useDownloadManager: true,
notification,
title: name,
path: ReactNativeBlobUtil.wrap( ${DownloadDir}/${name}.${extension}
),
},
},
}) as ReactNativeBlobUtilConfig
}
`
from react-native-blob-util.
diff --git a/node_modules/react-native-blob-util/fetch.js b/node_modules/react-native-blob-util/fetch.js
index ed4e67f..fe541e5 100644
--- a/node_modules/react-native-blob-util/fetch.js
+++ b/node_modules/react-native-blob-util/fetch.js
@@ -270,8 +270,8 @@ export function fetch(...args: any): Promise {
fs.session(options.session).add(data);
}
respInfo.rnfbEncode = rawType;
- if ('uninit' in respInfo && respInfo.uninit) // event didn't fire yet so we override it here
- respInfo = responseInfo;
+ // if ('uninit' in respInfo && respInfo.uninit) // event didn't fire yet so we override it here
+ // respInfo = responseInfo;
resolve(new FetchBlobResponse(taskId, respInfo, data));
}
It work for me.
from react-native-blob-util.
Downgrade to 0.19.4 cause this error #204
from react-native-blob-util.
Hi @mMarcos208 I think the issue is with package version, I also stumbled on the same error. So, I downgraded the version to
[email protected]
it works for me. Hope it helps.
I have the same issue, reverting back to 0.19.4 solved it for now
from react-native-blob-util.
Comment the two line(273, 274) in fetch.js
fs.session(options.session).add(data); } respInfo.rnfbEncode = rawType; - if ('uninit' in respInfo && respInfo.uninit) // event didn't fire yet so we override it here - respInfo = responseInfo; + // if ('uninit' in respInfo && respInfo.uninit) // event didn't fire yet so we override it here + // respInfo = responseInfo; resolve(new FetchBlobResponse(taskId, respInfo, data)); }
This method worked for me, thank you. However, I didn't understand why such a change was made in the package; the commit messages were not explanatory.
from react-native-blob-util.
Any update? still facing this issue, and downgrading to 0.19.4 also doesn't resolve the issue
from react-native-blob-util.
Comment the two line(273, 274) in fetch.js
fs.session(options.session).add(data); } respInfo.rnfbEncode = rawType; - if ('uninit' in respInfo && respInfo.uninit) // event didn't fire yet so we override it here - respInfo = responseInfo; + // if ('uninit' in respInfo && respInfo.uninit) // event didn't fire yet so we override it here + // respInfo = responseInfo; resolve(new FetchBlobResponse(taskId, respInfo, data)); }
This patch also fixed the issue for me, thanks!
from react-native-blob-util.
Hi @mMarcos208 I think the issue is with package version, I also stumbled on the same error. So, I downgraded the version to
[email protected]
it works for me. Hope it helps.
It works for me.
from react-native-blob-util.
Can you tell me in which line this fails exactly?
Does it happen on Android or iOS or both?
Would like to fix this.
But to explain the changes.
There are cases where the native events are triggered after the callback is triggered. Therefor the callback gets all information and if the event happens to arrive after the callback we still can resolve with all required information.
Just that seems like I missed something
from react-native-blob-util.
In my case it only happens on Android. The same code on iOS works fine.
Version 0.19.4 works well on both platforms.
from react-native-blob-util.
+1 seeing this issue. 0.19.4 fixes it for me as well.
from react-native-blob-util.
Hi @mMarcos208, I have fixed this issue by wrapping the path with path: ReactNativeBlobUtil.wrap(filePath)
` import {Platform} from 'react-native' import ReactNativeBlobUtil, {ReactNativeBlobUtilConfig} from 'react-native-blob-util'
export const options = (name: string, extension = 'pdf', notification = true) => { const {fs} = ReactNativeBlobUtil const { dirs: {DocumentDir, DownloadDir}, } = fs return Platform.select({ ios: { fileCache: true, path: ReactNativeBlobUtil.wrap(
${DocumentDir}/${name}
), title: name, }, android: { fileCache: true, addAndroidDownloads: { useDownloadManager: true, notification, title: name, path: ReactNativeBlobUtil.wrap(${DownloadDir}/${name}.${extension}
), }, }, }) as ReactNativeBlobUtilConfig } `
worked for me
from react-native-blob-util.
Hi @mMarcos208 I think the issue is with package version, I also stumbled on the same error. So, I downgraded the version to
[email protected]
it works for me. Hope it helps.
Downgrading from 0.19.6 to 0.19.4 fixed the error in my case. Thanks.
from react-native-blob-util.
@mMarcos208 @paskalov-aris @endrits079
Anyone can tell we whitch line is causing the probelm?
And is it an on progress event or when the request is finished?
Android / ios / both?
Some more information to reproduce it would be great so you don't have to downgrade
from react-native-blob-util.
Hi @mMarcos208 I think the issue is with package version, I also stumbled on the same error. So, I downgraded the version to
[email protected]
it works for me. Hope it helps.
It's also worked for me. Thanks @Mohamed-Sheik-Ali
from react-native-blob-util.
@mMarcos208 @paskalov-aris @endrits079 Anyone can tell we whitch line is causing the probelm? And is it an on progress event or when the request is finished? Android / ios / both?
Some more information to reproduce it would be great so you don't have to downgrade
@bhavdeep-pixer same question to you.
from react-native-blob-util.
Hi @mMarcos208 I think the issue is with package version, I also stumbled on the same error. So, I downgraded the version to
[email protected]
it works for me. Hope it helps.
Thanks solved my issue
from react-native-blob-util.
The file got downloaded but cannot locate it in the device file manager. It was downloaded to the internal app which is not visible.
How can this be fixed, please?
from react-native-blob-util.
Related Issues (20)
- iOS privacy manifest HOT 1
- Android Download Manager notification only shows up at the end
- response.json() is throwing an Error in Android saying No such file or directory HOT 1
- dest.exists() check fails in writeStream() in files of type content:// HOT 1
- Using writeStream() with content:// Uris HOT 1
- File gets corrupted with readStream() with base64 when using bufferSize defaults
- java to kotlin change example HOT 5
- pathForAppGroup typescript error HOT 1
- Error opening APK file: installation package is corrupt HOT 3
- Integration network debugging react-native-debugger HOT 1
- Crash when readStream on IOS
- Problem with java.lang.RuntimeException: java.lang.IllegalStateException: Use of own trust manager but none defined HOT 1
- wifiOnly option doesn't work on iOS as expected
- copyToMediaStore does not work on Android versions lower than 10 HOT 2
- Upload Video [Error: The operation couldn’t be completed. Message too long] HOT 3
- [Error: Unexpected FileStorage response file: null] on android 14 HOT 1
- Run error in windows, due to the WindowsTargetPlatformMinVersion
- ReactNativeBlobUtil.fs does not work if path contains 'content://' HOT 1
- How to get access to assets file (issue opened after trouble shooting read). HOT 2
- Android 14 PDF Issues HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-blob-util.