i want to download file that i upload to the server with node js and framework sailsjs
$scope.download = function(l,n){
console.log(n);
var fs = require('fs');
var http = require('http');
var file = fs.createWriteStream(n);
var request = http.get(l, function(response) {
response.pipe(file);
});
}
and when i click to download this error message i get: ReferenceError: require is not defined
in this 2 file : var fs = require('fs'); var http = require('http');
and i install before fs and http in npm install
thanks for the help