{"action":"created","issue":{"url":"https://api.github.com/repos/jyu213/ssh2-sftp-client/issues/73","repository_url":"https://api.github.com/repos/jyu213/ssh2-sftp-client","labels_url":"https://api.github.com/repos/jyu213/ssh2-sftp-client/issues/73/labels{/name}","comments_url":"https://api.github.com/repos/jyu213/ssh2-sftp-client/issues/73/comments","events_url":"https://api.github.com/repos/jyu213/ssh2-sftp-client/issues/73/events","html_url":"https://github.com/jyu213/ssh2-sftp-client/issues/73","id":326522700,"node_id":"MDU6SXNzdWUzMjY1MjI3MDA=","number":73,"title":"multiple files upload","user":{"login":"estivalet","id":4981831,"node_id":"MDQ6VXNlcjQ5ODE4MzE=","avatar_url":"https://avatars0.githubusercontent.com/u/4981831?v=4","gravatar_id":"","url":"https://api.github.com/users/estivalet","html_url":"https://github.com/estivalet","followers_url":"https://api.github.com/users/estivalet/followers","following_url":"https://api.github.com/users/estivalet/following{/other_user}","gists_url":"https://api.github.com/users/estivalet/gists{/gist_id}","starred_url":"https://api.github.com/users/estivalet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/estivalet/subscriptions","organizations_url":"https://api.github.com/users/estivalet/orgs","repos_url":"https://api.github.com/users/estivalet/repos","events_url":"https://api.github.com/users/estivalet/events{/privacy}","received_events_url":"https://api.github.com/users/estivalet/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-05-25T13:24:07Z","updated_at":"2018-06-15T21:55:56Z","closed_at":null,"author_association":"NONE","body":"I'm not able to upload multiple files, probabling coding it wrong. Could someone provide me an example of multiple file upload? I want to upload over 500 files and in the end of all of them I want to return if the upload was success or not. thanks"},"comment":{"url":"https://api.github.com/repos/jyu213/ssh2-sftp-client/issues/comments/397752300","html_url":"https://github.com/jyu213/ssh2-sftp-client/issues/73#issuecomment-397752300","issue_url":"https://api.github.com/repos/jyu213/ssh2-sftp-client/issues/73","id":397752300,"node_id":"MDEyOklzc3VlQ29tbWVudDM5Nzc1MjMwMA==","user":{"login":"slamus","id":2813579,"node_id":"MDQ6VXNlcjI4MTM1Nzk=","avatar_url":"https://avatars0.githubusercontent.com/u/2813579?v=4","gravatar_id":"","url":"https://api.github.com/users/slamus","html_url":"https://github.com/slamus","followers_url":"https://api.github.com/users/slamus/followers","following_url":"https://api.github.com/users/slamus/following{/other_user}","gists_url":"https://api.github.com/users/slamus/gists{/gist_id}","starred_url":"https://api.github.com/users/slamus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slamus/subscriptions","organizations_url":"https://api.github.com/users/slamus/orgs","repos_url":"https://api.github.com/users/slamus/repos","events_url":"https://api.github.com/users/slamus/events{/privacy}","received_events_url":"https://api.github.com/users/slamus/received_events","type":"User","site_admin":false},"created_at":"2018-06-15T21:55:56Z","updated_at":"2018-06-15T21:55:56Z","author_association":"NONE","body":"Hi, \r\n\r\nI did it that way\r\n\r\n```js\r\nconst putFiles = (sftpConfig) => (fileList) => {\r\n  const sftp = new sftpClient()\r\n  return new Promise(function(resolve, reject) {\r\n    sftp\r\n    .connect(sftpConfig)\r\n    .then(() => {\r\n      return Promise.all(fileList.map(args => {\r\n        return sftp.put.apply(sftp, args)\r\n      }))\r\n    })\r\n    .then(() => sftp.end())\r\n    .then(resolve)\r\n    .catch(reject)\r\n  });\r\n}\r\n```\r\n\r\nYou could replace the first line with this if you don't want a closure-like behaviour\r\n```\r\nconst putFiles = (sftpConfig, fileList) => {\r\n```\r\n\r\n\r\nGood Luck ;-)\r\n"}}
{"actor":{"display_login":"slamus"}}