node.js - how can I write file to windows system folder? -


i want add new fonts windows system folder electron, failed, how this? here code can work in app folder.i want put file in 'c:\windows\fonts', thank u.

var request = http.get("http://www.mysites.com/newfont.ttf", function(response) {  		if (response.statuscode === 200) {  			var file = fs.createwritestream("app/font.ttf");  			response.pipe(file);  		}  	});

in error can see http not defined, tell you forget require http module. way have same thing fs module no ?


Comments

Popular posts from this blog

'hasOwnProperty' in javascript -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -

How to understand 2 main() functions after using uftrace to profile the C++ program? -