{"action":"created","issue":{"url":"https://api.github.com/repos/expressjs/multer/issues/344","repository_url":"https://api.github.com/repos/expressjs/multer","labels_url":"https://api.github.com/repos/expressjs/multer/issues/344/labels{/name}","comments_url":"https://api.github.com/repos/expressjs/multer/issues/344/comments","events_url":"https://api.github.com/repos/expressjs/multer/issues/344/events","html_url":"https://github.com/expressjs/multer/issues/344","id":153855401,"node_id":"MDU6SXNzdWUxNTM4NTU0MDE=","number":344,"title":"File size limit cancels file upload only after all bytes are received","user":{"login":"csaroff","id":7225723,"node_id":"MDQ6VXNlcjcyMjU3MjM=","avatar_url":"https://avatars2.githubusercontent.com/u/7225723?v=4","gravatar_id":"","url":"https://api.github.com/users/csaroff","html_url":"https://github.com/csaroff","followers_url":"https://api.github.com/users/csaroff/followers","following_url":"https://api.github.com/users/csaroff/following{/other_user}","gists_url":"https://api.github.com/users/csaroff/gists{/gist_id}","starred_url":"https://api.github.com/users/csaroff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csaroff/subscriptions","organizations_url":"https://api.github.com/users/csaroff/orgs","repos_url":"https://api.github.com/users/csaroff/repos","events_url":"https://api.github.com/users/csaroff/events{/privacy}","received_events_url":"https://api.github.com/users/csaroff/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-05-09T19:53:21Z","updated_at":"2018-06-28T08:44:54Z","closed_at":null,"author_association":"NONE","body":"I've been using multer for file uploads, and I've noticed an issue with the file size limit.  I'm using the limits option to prevent the upload of files that are too large.\n\n``` javascript\n  const upload = multer({\n    storage: multer.memoryStorage(),\n    limits: {\n      fieldNameSize: 255,\n      fileSize: 500000,\n      files: 1,\n      fields: 1\n    }\n  });\n```\n\nWhen uploading an image to my API, multer seems to wait until it has received all of the image bytes before failing with the \"LIMIT_FILE_SIZE\" code.\n\nIsn't it a security vulnerability if your API allows someone to upload an arbitrarily large file _before_ failing the request?  Is there another technique for preventing the behavior?\n"},"comment":{"url":"https://api.github.com/repos/expressjs/multer/issues/comments/400960141","html_url":"https://github.com/expressjs/multer/issues/344#issuecomment-400960141","issue_url":"https://api.github.com/repos/expressjs/multer/issues/344","id":400960141,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMDk2MDE0MQ==","user":{"login":"mbiakov","id":36674147,"node_id":"MDQ6VXNlcjM2Njc0MTQ3","avatar_url":"https://avatars1.githubusercontent.com/u/36674147?v=4","gravatar_id":"","url":"https://api.github.com/users/mbiakov","html_url":"https://github.com/mbiakov","followers_url":"https://api.github.com/users/mbiakov/followers","following_url":"https://api.github.com/users/mbiakov/following{/other_user}","gists_url":"https://api.github.com/users/mbiakov/gists{/gist_id}","starred_url":"https://api.github.com/users/mbiakov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbiakov/subscriptions","organizations_url":"https://api.github.com/users/mbiakov/orgs","repos_url":"https://api.github.com/users/mbiakov/repos","events_url":"https://api.github.com/users/mbiakov/events{/privacy}","received_events_url":"https://api.github.com/users/mbiakov/received_events","type":"User","site_admin":false},"created_at":"2018-06-28T08:44:54Z","updated_at":"2018-06-28T08:44:54Z","author_association":"NONE","body":"+1"}}
{"actor":{"display_login":"mbiakov"}}