Good morning to all,
I'm trying to download a file from my server to the user's computer. And you may specify where it should be downloaded.
Is there any way to do this?
I'm with:
window.frame.openDialog({
type: 'save',
title: 'Save...',
multiSelect: false,
dirSelect:true,
initialValue:'c:\\Program Files'
}, function( err , files ) {
var http = require('http');
var fs = require('fs');
var file = fs.createWriteStream("image.png");
var request = http.get("http://miserver.com/image.jpg", function(response) {
response.pipe(file);
});
});
That code I save the file, but not where the user has indicated. Also, I can not know how much has downloaded ... Is it possible?
Hehe .... thanks for reading