javascript - How to upload files from a meteor/node server? -


note i'm trying upload from meteor/node server. i'm trying interface echosign rest api. have upload pdf server theirs using multipart post. i've figured out how normal post server using node.

if possible, i'd without using modules besides standard node modules fs & http.

here's code far:

var http = require('http');    options = {    host: 'localhost',    port:8080,    path: '/upload',    method: 'post',  };    var callback = function(response) {    response.setencoding('utf-8');    var responsestring = '';    response.on('data', function(data) {      responsestring += data;    });    response.on('end', function() {      console.log(responsestring);    });  }    var request = http.request(options, callback);  request.on('error', function(e) {    console.log('there error: '+e);  });  request.end();

can point me in right direction?

well, in end, wasn't able generate multipart body successfully, used restler package instead. handles difficult stuff you, however, think should included in meteor.call() function.


Comments

Popular posts from this blog

python - Mongodb How to add addtional information when aggregating? -

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

java - Incorrect order of records in M-M relationship in hibernate -