クライアント側の JavaScript から CSV ファイルを Post リクエストとしてノード サーバーにアップロードしています。nodejsサーバーでもリクエストを処理できます。サーバー側でファイルを取得して解析するのを手伝ってください。ファイルはcsvファイルになり、ファイルを解析してファイルの内容を読み取る必要があります。
参照用に、クライアント側とサーバー側でファイルをアップロードするためのソース コード スニペットを以下に添付します。
myAngularApp.service('fileUpload', ['$http', function ($http) {
this.uploadFileToUrl = function(file, uploadUrl){
var fd = new FormData();
fd.append('file', file);
$http.post(uploadUrl, fd, {
transformRequest: angular.identity,
headers: {'Content-Type': undefined}
})
.success(function(){
// handling on success data
})
.error(function(){
// handling on error data
});
}
NodeJs サーバー上:
router.post('/filter-reports', function(req, res) {
console.log('Came inside the Node js router.. Now.. its all up to me to format the data....');
console.log(req);
});