I had a question reg. moving a file using Node.
In the end - I have a local file on M drive (Mapped) and want to move/copy it to N drive.
Using fsStream I was able to move it locally, but I'm concerned how it will react once I put it onto a website due to file manipulation. I'm curious if anyone has any solutions - I originally was using File API, which was beautiful but I noticed all it can do is load the data, I was unable to 'save' it anywhere.
Script is very simple - Mostly I'll be using variables to assign the write-to/read to path. I'm struggling to find info on how to write from server to PC, just a lot of reasons why it can't be done due to violation.
My other option is possibly just using a Powershell script?
var fs = require('fs'),
util = require('util');
var origFile = '~origPath~'
var destFile = '~destPath'
var is = fs.createReadStream(origFile)
var os = fs.createWriteStream(destFile);
util.pump(is, os, function() {
fs.unlinkSync(origFile);
});
Thanks ahead of time. Sorry if my post lacks needed details. I'll edit once I know.