{"action":"created","issue":{"url":"https://api.github.com/repos/archiverjs/node-archiver/issues/165","labels_url":"https://api.github.com/repos/archiverjs/node-archiver/issues/165/labels{/name}","comments_url":"https://api.github.com/repos/archiverjs/node-archiver/issues/165/comments","events_url":"https://api.github.com/repos/archiverjs/node-archiver/issues/165/events","html_url":"https://github.com/archiverjs/node-archiver/issues/165","id":113471693,"number":165,"title":"Issue with request (form-data?)","user":{"login":"dwieeb","id":236501,"avatar_url":"https://avatars.githubusercontent.com/u/236501?v=3","gravatar_id":"","url":"https://api.github.com/users/dwieeb","html_url":"https://github.com/dwieeb","followers_url":"https://api.github.com/users/dwieeb/followers","following_url":"https://api.github.com/users/dwieeb/following{/other_user}","gists_url":"https://api.github.com/users/dwieeb/gists{/gist_id}","starred_url":"https://api.github.com/users/dwieeb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dwieeb/subscriptions","organizations_url":"https://api.github.com/users/dwieeb/orgs","repos_url":"https://api.github.com/users/dwieeb/repos","events_url":"https://api.github.com/users/dwieeb/events{/privacy}","received_events_url":"https://api.github.com/users/dwieeb/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-26T23:24:17Z","updated_at":"2016-01-01T23:27:47Z","closed_at":"2016-01-01T23:27:47Z","body":"I encountered an issue with using archiver as a readable stream shoved into request form parameters. I'm not sure which module is at fault, or if I'm something something wrong. I've been at it all day.\r\n\r\nI believe the archiver stream is somehow invalidating the format of the post request. The following example works if `value: z1,` is replaced with `value: fs.createReadStream('...'),`. \r\n\r\nHow can I get archiver to work as a readable stream that I can send over the wire as a post parameter?\r\n\r\nsetup:\r\n```bash\r\n$ npm install archiver request\r\n```\r\n \r\nrequest.js\r\n```javascript\r\nvar archiver = require('archiver');\r\nvar request = require('request');\r\n\r\nvar z1 = archiver('zip');\r\n\r\nz1.on('error', function(err) {\r\n  console.log(\"ERROR\", err.stack);\r\n});\r\n\r\nz1.append('HELLO THERE, CAPTAIN', { name: 'capngreet.txt' });\r\nz1.finalize();\r\n\r\nrequest.post({\r\n    url: 'http://localhost:7050',\r\n    formData: {\r\n        some_var: 5,\r\n        file: {\r\n            value: z1,\r\n            options: {\r\n                filename: 'capngreet.zip',\r\n                contentType: 'application/zip'\r\n            }\r\n        }\r\n    }\r\n}, function(err, resp, body) {\r\n    if (err) throw err;\r\n    console.log(body);\r\n});\r\n```\r\n\r\nFor the server side component, just have something that dumps out the post params and files and you'll see they get invalidated when using archiver's stream."},"comment":{"url":"https://api.github.com/repos/archiverjs/node-archiver/issues/comments/168350292","html_url":"https://github.com/archiverjs/node-archiver/issues/165#issuecomment-168350292","issue_url":"https://api.github.com/repos/archiverjs/node-archiver/issues/165","id":168350292,"user":{"login":"ctalkington","id":209757,"avatar_url":"https://avatars.githubusercontent.com/u/209757?v=3","gravatar_id":"","url":"https://api.github.com/users/ctalkington","html_url":"https://github.com/ctalkington","followers_url":"https://api.github.com/users/ctalkington/followers","following_url":"https://api.github.com/users/ctalkington/following{/other_user}","gists_url":"https://api.github.com/users/ctalkington/gists{/gist_id}","starred_url":"https://api.github.com/users/ctalkington/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ctalkington/subscriptions","organizations_url":"https://api.github.com/users/ctalkington/orgs","repos_url":"https://api.github.com/users/ctalkington/repos","events_url":"https://api.github.com/users/ctalkington/events{/privacy}","received_events_url":"https://api.github.com/users/ctalkington/received_events","type":"User","site_admin":false},"created_at":"2016-01-01T23:27:47Z","updated_at":"2016-01-01T23:27:47Z","body":"thanks @soyuka, closing for now as this seems un-related to archiver itself."}}