Uploading a file programmatically, from node.js, to another web server

I need to push a file from a node.js app, to a web server running elsewhere, which accepts files via the typical upload mechanism. For instance, say the receiving server has a page with a form like this:

<form enctype="multipart/form-data" action="upload.php" method="POST">
 file: <input name="uploaded" type="file" /><br />
 name: <input type="text" name="filename" /><br />
 <input type="submit" value="upload" />
 </form>

If the user selects a file, and then gives a filename in the text input field, that file will be uploaded to the server, via upload.php (which I don't control), and saved as the name supplied. (there might be other items on the form, but I'm showing only those for simplicity). The php script will respond with a simple text response of "ok" or "error ..." (with the error).

Now, I want to be able to send a file from node.js to that php script, programmatically. The file (on the node.js side) may or may not exist in the filesystem, or it could be something that comes in from somewhere else, for instance I might pull it down from a url, it might be uploaded by a user, etc.

I've seen some stuff along these lines, but I'm not sure how to deal with the parameters (filename, etc), nor am I sure what to supply in the options object. Also this example assumes it is coming from a file-system file, which as I say may or may not be the case.

fs.createReadStream(filename).pipe(http.request(options, function(response) {
}));

I ended up just using the module "poster" which made it easy. Here is a thin wrapper around the call to poster. "fileId" is the name of the form element representing the file, other parameters are just put in the "fields" object.

var _poster = require('poster');

var uploadFileToRemoteServer = function (remoteScript, filename, fileId, fields, cb) {
    _poster.post(
      filename,
      {
        uploadUrl: remoteScript,
        method: "POST",
        fileId: fileId,
        fields: fields || {}
      },
      function (err, r) {
        if (err) {
        } else {
          if(cb)
            cb(r);
        }
      });
  }