{"issue":{"milestone":null,"user":{"id":30813,"login":"everzet","url":"https://api.github.com/users/everzet","gravatar_id":"f742011db78e0c681ed4bc885bfee982","avatar_url":"https://secure.gravatar.com/avatar/f742011db78e0c681ed4bc885bfee982?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"created_at":"2011-12-20T12:30:29Z","title":"multipart/form-data form with multiselect","labels":[],"state":"open","updated_at":"2011-12-20T12:30:29Z","id":2612333,"closed_at":null,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"html_url":"https://github.com/assaf/zombie/issues/234","body":"`zombie@0.12.7` in `v0.6.5+` always throws an `TypeError: first argument must be a string or Buffer` exception, when you're trying to submit form with `enctype=\"multipart/form-data\"`, that has `<select multiple=\"multiple\">` in it.\r\n\r\nExample to reproduce:\r\n\r\n``` js\r\nvar zombie  = require('zombie')\r\n  , browser = new zombie.Browser();\r\n\r\nbrowser.visit('http://test.mink.dev/zombie_bug.html', function() {\r\n    browser.fill('first_name', 'Konstantin');\r\n    browser.pressButton('submit', function() {\r\n        // never executed because of exception\r\n    });\r\n});\r\n```\r\n\r\n``` html\r\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"ru\">\r\n<head>\r\n    <title>Multipart form with multiselect</title>\r\n    <meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\"/>\r\n</head>\r\n<body>\r\n    <form method=\"POST\" enctype=\"multipart/form-data\" action=\"/advanced_form_post.php\">\r\n        <input name=\"first_name\" value=\"\" type=\"text\" />\r\n\r\n        <select name=\"select_multiple_numbers[]\" multiple=\"multiple\">\r\n            <option value=\"1\">one</option>\r\n            <option value=\"2\">two</option>\r\n            <option value=\"3\">three</option>\r\n        </select>\r\n\r\n        <input type=\"file\" name=\"about\" />\r\n\r\n        <input type=\"submit\" name=\"submit\" value=\"Submit\" />\r\n    </form>\r\n</body>\r\n</html>\r\n```\r\n\r\nIt always throws:\r\n\r\n``` bash\r\nnode.js:201\r\n        throw e; // process.nextTick error, or 'error' event on first tick\r\n              ^\r\nTypeError: first argument must be a string or Buffer\r\n    at ClientRequest.write (http.js:601:11)\r\n    at Resources._makeRequest (/usr/local/lib/node_modules/zombie/lib/zombie/resources.coffee:316:26)\r\n    at /usr/local/lib/node_modules/zombie/lib/zombie/resources.coffee:136:22\r\n    at EventLoop.perform (/usr/local/lib/node_modules/zombie/lib/zombie/eventloop.coffee:116:7)\r\n    at Resources.request (/usr/local/lib/node_modules/zombie/lib/zombie/resources.coffee:135:39)\r\n    at History._resource (/usr/local/lib/node_modules/zombie/lib/zombie/history.coffee:120:38)\r\n    at History._submit (/usr/local/lib/node_modules/zombie/lib/zombie/history.coffee:239:19)\r\n    at /usr/local/lib/node_modules/zombie/lib/zombie/forms.coffee:63:24\r\n    at /usr/local/lib/node_modules/zombie/lib/zombie/forms.coffee:59:16\r\n    at /usr/local/lib/node_modules/zombie/lib/zombie/forms.coffee:59:16\r\n```\r\n\r\nIf you remove either `enctype=\"multipart/form-data\"` from form OR `multiple=\"multiple\"` bug disappears, but together - they simply don't work.","number":234,"url":"https://api.github.com/repos/assaf/zombie/issues/234","comments":0,"assignee":null},"action":"opened"}