GithubHelp home page GithubHelp logo

file downloads, but it shows 0 byte size using "Download Notification and Visibility in Download App (Android Only)" about rn-fetch-blob HOT 3 OPEN

joltup avatar joltup commented on September 28, 2024
file downloads, but it shows 0 byte size using "Download Notification and Visibility in Download App (Android Only)"

from rn-fetch-blob.

Comments (3)

RituMandloi avatar RituMandloi commented on September 28, 2024 2

@tacktile, please use 'useDownloadManager' key in android config and remove 'mediaScannable' key options as follows:
addAndroidDownloads : {
useDownloadManager : true, // <-- this is the only thing required
// Optional, override notification setting (default to true)
notification : false,
// Optional, but recommended since android DownloadManager will fail when
// the url does not contains a file extension, by default the mime type will be text/plain
mime : 'text/plain',
description : 'File downloaded by download manager.'
}

from rn-fetch-blob.

anurag-tspl avatar anurag-tspl commented on September 28, 2024
  1. "react-native": "0.55.4"

  2. "react-native-fetch-blob": "^0.10.8"
    using above library version of react native and react-native-fetch-blob respectively.

  3. Sample Code
    downloadFile(){
    var d = new Date();
    RNFetchBlob
    .config({
    fileCache : true,
    // android only options, these options be a no-op on IOS
    addAndroidDownloads : {
    // Show notification when response data transmitted
    notification : true,
    // Title of download notification
    title : 'certificate_1.png',
    // File description (not notification description)
    description : 'pdf file',
    mime : 'image/png',
    // Make the file scannable by media scanner
    mediaScannable : true,
    }
    })
    .fetch('GET', 'http://www.example.com/Screenshot_1.png')
    .then((resp) => {
    // the path of downloaded file
    console.log(resp)
    })
    }

from rn-fetch-blob.

viv3kk avatar viv3kk commented on September 28, 2024

I am getting this ...But cannot locate file.
The file saved to /data/user/0/com.geniolite/files/RNFetchBlobTmp_gesob1gmrxmbp64baisfn

from rn-fetch-blob.

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.