We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, Can i use node-webkit to download files with percentage ? something like google chrome download manager or some help with javascript/node ..
in this application, users have an option to download mp3 files .. is there any way to show a percentage-bar after save-dialog ? thank you.
The text was updated successfully, but these errors were encountered:
Depends on how you download the file but I solved it this way with a http download:
function download(file_url){ var fs = require('fs'); var url = require('url'); var http = require('http'); var options = { host: url.parse(file_url).host, port: 80, path: url.parse(file_url).pathname }; var file_name = url.parse(file_url).pathname.split('/').pop(); var file = fs.createWriteStream('./' + file_name); http.get(options, function(res) { var fsize = res.headers['content-length']; res.on('data', function(data) { file.write(data); progress(100-(((fsize-file.bytesWritten)/fsize)*100), $('#progressBar')); }).on('end', function() { file.end(); }); }); } function progress(percent, $element) { console.log("Download: "+parseInt(percent)+" %") var progressBarWidth = percent * $element.width() / 100; $element.find('div').css( "width", progressBarWidth ); }
Hope that helps you. Gave me some headache aswell to get a proper status bar going.
Sorry, something went wrong.
Thank you very much ! i made some changes to use it with 'save file' with save dialog .. createWriteStream ... such a nice method !
No branches or pull requests
Hi,
Can i use node-webkit to download files with percentage ? something like google chrome download manager or some help with javascript/node ..
in this application, users have an option to download mp3 files ..
is there any way to show a percentage-bar after save-dialog ?
thank you.
The text was updated successfully, but these errors were encountered: