plrthink / react-native-file-download Goto Github PK
View Code? Open in Web Editor NEW[DEPRECATED] Native file download utility for react-native
License: MIT License
[DEPRECATED] Native file download utility for react-native
License: MIT License
Hi,
How can i save as file with new name ?
Thanks.
I rewrote the call to:
RNFileDownloadSessionManager *manager = [[RNFileDownloadSessionManager alloc] initWithTargetPath:targetPath downloadFileName:fileName bridge:self.bridge callback:callback];
Eliminating the new line formatting and then did a project clean and build, it then worked.
Anyone else experiencing the same?
///////inside package.json
"react-native": "git+https://github.com/exponentjs/react-native#sdk-12.0.0",
"react-native-cache-image": "^1.0.0",
"react-native-file-download": "0.0.10",
"react-native-fs": "^2.3.3",
///////inside component
const FileDownload = require('react-native-file-download');
const RNFS = require('react-native-fs');
const URL = downloadpath;
const DEST = RNFS.DocumentDirectoryPath
const fileName = 'zip.zip'
const headers = {
'Accept-Language': 'en-US'
}
FileDownload.addListener(URL, (info) => {
console.log(complete ${(info.totalBytesWritten / info.totalBytesExpectedToWrite * 100)}%
);
});
FileDownload.download(URL, "DEST", fileName, headers)
.then((response) => {
console.log(downloaded! file saved to: ${response}
)
})
.catch((error) => {
console.log(error)
})
var RNFileDownload = NativeModules.RNFileDownload;
var promisify = require("es6-promisify")
let progressEventName = 'RNFileDownloadProgress'
let progressEventTable = {}
var _download = promisify(RNFileDownload.download)
var _error = (err) => {
throw err
}
in index.ios.js file of package line number 12
I am using
"react": "16.0.0-alpha.12",
"react-native": "0.47.2",
xcode-8.3.2
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.