Created
September 27, 2013 06:09
-
-
Save redfield/6724717 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var FormData = require('form-data'), | |
fs = require("fs"); | |
var form = new FormData(); | |
form.append('user', 'HYPDF_USER'); | |
form.append('password', 'HYPDF_PASSWORD'); | |
form.append('test', 'true'); | |
form.append('bucket', 'hypdf_test'); | |
form.append('key', 'hypdf_test.pdf'); | |
form.append('public', 'true'); | |
form.append('file1', fs.createReadStream('/path/to/file1.pdf')); | |
form.append('file2', fs.createReadStream('/path/to/file2.pdf')); | |
form.append('file3', fs.createReadStream('/path/to/file3.pdf')); | |
form.submit('https://www.hypdf.com/pdfunite', function(err, res) { | |
// res – response object (http.IncomingMessage) | |
console.log(res.statusCode, res.resume()); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment