{"action":"created","issue":{"url":"https://api.github.com/repos/strongloop/loopback-next/issues/1873","repository_url":"https://api.github.com/repos/strongloop/loopback-next","labels_url":"https://api.github.com/repos/strongloop/loopback-next/issues/1873/labels{/name}","comments_url":"https://api.github.com/repos/strongloop/loopback-next/issues/1873/comments","events_url":"https://api.github.com/repos/strongloop/loopback-next/issues/1873/events","html_url":"https://github.com/strongloop/loopback-next/issues/1873","id":371520163,"node_id":"MDU6SXNzdWUzNzE1MjAxNjM=","number":1873,"title":"File upload with multipart/form-data","user":{"login":"diegolacarta","id":6614327,"node_id":"MDQ6VXNlcjY2MTQzMjc=","avatar_url":"https://avatars0.githubusercontent.com/u/6614327?v=4","gravatar_id":"","url":"https://api.github.com/users/diegolacarta","html_url":"https://github.com/diegolacarta","followers_url":"https://api.github.com/users/diegolacarta/followers","following_url":"https://api.github.com/users/diegolacarta/following{/other_user}","gists_url":"https://api.github.com/users/diegolacarta/gists{/gist_id}","starred_url":"https://api.github.com/users/diegolacarta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diegolacarta/subscriptions","organizations_url":"https://api.github.com/users/diegolacarta/orgs","repos_url":"https://api.github.com/users/diegolacarta/repos","events_url":"https://api.github.com/users/diegolacarta/events{/privacy}","received_events_url":"https://api.github.com/users/diegolacarta/received_events","type":"User","site_admin":false},"labels":[{"id":817780663,"node_id":"MDU6TGFiZWw4MTc3ODA2NjM=","url":"https://api.github.com/repos/strongloop/loopback-next/labels/REST","name":"REST","color":"fcc53a","default":false},{"id":534463431,"node_id":"MDU6TGFiZWw1MzQ0NjM0MzE=","url":"https://api.github.com/repos/strongloop/loopback-next/labels/feature","name":"feature","color":"c2e0c6","default":false},{"id":1117078886,"node_id":"MDU6TGFiZWwxMTE3MDc4ODg2","url":"https://api.github.com/repos/strongloop/loopback-next/labels/function%20parity","name":"function parity","color":"f45fbe","default":false},{"id":722802089,"node_id":"MDU6TGFiZWw3MjI4MDIwODk=","url":"https://api.github.com/repos/strongloop/loopback-next/labels/help%20wanted","name":"help wanted","color":"0e8a16","default":true},{"id":891645909,"node_id":"MDU6TGFiZWw4OTE2NDU5MDk=","url":"https://api.github.com/repos/strongloop/loopback-next/labels/needs-grooming","name":"needs-grooming","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2018-10-18T13:04:12Z","updated_at":"2018-11-06T13:18:55Z","closed_at":null,"author_association":"NONE","body":"Is there any way to handle an upload with multipart/form-data? I'm trying to migrate a simple piece of code that works in express to loopback, and can't find any docs for v4.\r\n\r\nThe issue is it never gets to the controller, and returns an error saying multipart/form-data is not supported.\r\n\r\nThis is the code in expressjs:\r\n\r\n```js\r\n  app.post('/upload', (request, response) => {\r\n    const upload = multer().single('file')\r\n    upload(request, response, () => {\r\n      const {file} = request\r\n      ...\r\n    })\r\n  })\r\n```"},"comment":{"url":"https://api.github.com/repos/strongloop/loopback-next/issues/comments/436249443","html_url":"https://github.com/strongloop/loopback-next/issues/1873#issuecomment-436249443","issue_url":"https://api.github.com/repos/strongloop/loopback-next/issues/1873","id":436249443,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNjI0OTQ0Mw==","user":{"login":"bajtos","id":1140553,"node_id":"MDQ6VXNlcjExNDA1NTM=","avatar_url":"https://avatars1.githubusercontent.com/u/1140553?v=4","gravatar_id":"","url":"https://api.github.com/users/bajtos","html_url":"https://github.com/bajtos","followers_url":"https://api.github.com/users/bajtos/followers","following_url":"https://api.github.com/users/bajtos/following{/other_user}","gists_url":"https://api.github.com/users/bajtos/gists{/gist_id}","starred_url":"https://api.github.com/users/bajtos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bajtos/subscriptions","organizations_url":"https://api.github.com/users/bajtos/orgs","repos_url":"https://api.github.com/users/bajtos/repos","events_url":"https://api.github.com/users/bajtos/events{/privacy}","received_events_url":"https://api.github.com/users/bajtos/received_events","type":"User","site_admin":false},"created_at":"2018-11-06T13:18:55Z","updated_at":"2018-11-06T13:18:55Z","author_association":"MEMBER","body":"> What about even simpler solution - 5c2051d?\r\n>\r\n> Basically, we allow controller methods to skip body parsing by configuring `x-skip-body-parsing` and give the implementation the full control to handle `multipart/form-data`.\r\n\r\nI like this idea as a short-term workaround allowing LB4 app developers to build their own solutions for parsing multipart/form-data requests, buying us more time to implement the official support in a robust way.\r\n\r\nI am proposing the following approach:\r\n - Convert 5c2051d into a pull request. Add documentation (a HOWTO guide) explaining LB4 app developers how to handle file uploads.\r\n - Keep this issue open to discuss how to provide official support for file uploads that works OOTB, either as a built-in feature of `@loopback/rest` or as an extension."}}
{"actor":{"display_login":"bajtos"}}