Code Monkey home page Code Monkey logo

Comments (15)

skizzo avatar skizzo commented on July 20, 2024 2

First of all, thanks for your quick reply, @filipef101!

The didReceiveData() function in ReactNativeBlobUtilRequest.mm is only called a single time for a downloaded file, with the receivedBytes value set to the total file size.

I thought this might have to do with the configuration of our server where the file is loaded from, but even when trying to download an image from a placeholder service (in my case, https://placehold.co/1920x1080.png), the progress event is fired only once with 100%.

EDIT: When using a placeholder service (in my case, https://placehold.co/1920x1080.png), the progress event is fired multiple times and works correctly. So this is not a bug in the awesome react-native-blob-util module, but a misconfiguration of our server that hosts the images that are downloaded. Sorry for stealing your time!

from react-native-blob-util.

RonRadtke avatar RonRadtke commented on July 20, 2024 1

Just one more question, may I ask for the reason why the values for received and total in the .progress() function are returned as Strings, and not Numbers?

That's a good question - but in general all events arepassed as string or dict to JS . For the future only strings. But likely the typecast is simply missing.

from react-native-blob-util.

cristianoccazinsp avatar cristianoccazinsp commented on July 20, 2024

Can you hook into XCode and debug the lines around here? https://github.com/RonRadtke/react-native-blob-util/blob/master/ios/ReactNativeBlobUtilRequest.m#L321 (download) and https://github.com/RonRadtke/react-native-blob-util/blob/master/ios/ReactNativeBlobUtilRequest.m#L436 (upload)

Does the download handler work as expected? I have a feeling this code hasn't been updated in a long time and lots of deprecated/outdated functions are in use. I haven't tested this myself, but It looks like the bug shouldn't be hard to spot.

from react-native-blob-util.

akhilsanker avatar akhilsanker commented on July 20, 2024

Hi @cristianoccazinsp ,

Thanks for the reply. Will have a try and let you know.

Thanks

from react-native-blob-util.

akhilsanker avatar akhilsanker commented on July 20, 2024

Hi @cristianoccazinsp ,

Download progress also works like the same as upload progress.

Any solution for this behaviour in iOS ?

Thanks

from react-native-blob-util.

filipef101 avatar filipef101 commented on July 20, 2024

What happens when you remove .config(.. ?

from react-native-blob-util.

alessandro-bottamedi avatar alessandro-bottamedi commented on July 20, 2024

Same here, upload progress in iOS will only trigger two times, around 0.9 and then around completion... i do not have .config parameters...

from react-native-blob-util.

afilp avatar afilp commented on July 20, 2024

I have the same problem in iOS.

from react-native-blob-util.

YanaSyritskaya avatar YanaSyritskaya commented on July 20, 2024

The same problem in iOS.

from react-native-blob-util.

liukai-2p avatar liukai-2p commented on July 20, 2024

有解决办法吗

from react-native-blob-util.

skizzo avatar skizzo commented on July 20, 2024

Facing this too in iOS / react-native 0.71.7 / react-native-blob-util 0.17.3. Any updates?

from react-native-blob-util.

filipef101 avatar filipef101 commented on July 20, 2024

@skizzo I would start by checking this

Can you hook into XCode and debug the lines around here? https://github.com/RonRadtke/react-native-blob-util/blob/master/ios/ReactNativeBlobUtilRequest.m#L321 (download) and https://github.com/RonRadtke/react-native-blob-util/blob/master/ios/ReactNativeBlobUtilRequest.m#L436 (upload)

Does the download handler work as expected? I have a feeling this code hasn't been updated in a long time and lots of deprecated/outdated functions are in use. I haven't tested this myself, but It looks like the bug shouldn't be hard to spot.

from react-native-blob-util.

skizzo avatar skizzo commented on July 20, 2024

Just one more question, may I ask for the reason why the values for received and total in the .progress() function are returned as Strings, and not Numbers?

from react-native-blob-util.

crackhack8266 avatar crackhack8266 commented on July 20, 2024

@skizzo I am not getting progress in android as well it is coming as 0 and -1 for received and total respectively
and also download progress event is only firing once and that too when my file is downloaded completely then
any solutions please ?

from react-native-blob-util.

dongbach69 avatar dongbach69 commented on July 20, 2024

I have the same problem in iOS. have anyone fixed it?

from react-native-blob-util.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.