Improve upload of attachments to support chunks (with a size of 5M max).