In WebChat, the limit for “Images” is set to 4MB. This is problematic when using phone cameras to upload images for processing.
I don't think that limit is set by WebChat.
Hi @andynorton I don't believe we are setting any limit in the client side code, but we have seen similar reports for DirectLine. Can you provide a conversationID so that we can inspect on our server side?
An Azure Escalation Engineer said that “For WebChat, the limit for “Images” is set to 5MB. In my testing, I also noticed that the limit is currently 4MB.”
We’ve been unsuccessful when changing web config max file size options.
Seriously, the limit is not set by WebChat.
Okay thanks for coming back to me, would you have any suggestions on how this might be happening outside of WebChat, as we’ve struggled with anything over 4MB?
Please see my comment above
Hi @danmarshall - Conversation ID: AphyPzEXUHlJlBQclkCiqD. We've submitted 3 images under 4MB and 3 over.
@danmarshall - is that Conversation ID of any use?
Hello @andynorton - there was an error reading the multipart MIME body. Can you please share a file which causes the issue?
Hi @danmarshall - https://1drv.ms/i/s!AkI2BTKSRBbJhLpiIFwFrV-a3z1LAQ
An image over 4mb should cause the issue in our testing.
Thanks @andynorton that was very helpful. I've reproduced the error, and it is being limited on the server side in Direct Line. So, 4MB will be the max size limit until further notice. Sorry you had to find out with ad hoc testing, we should publish this in our documentation. Our team will be reviewing the size limit policy.
Thanks @danmarshall, we’d love to help out with any testing if this limit is increased in future. Could you post a link to the documentation you mentioned?
The documentation we have is for the Direct Line Rest API itself:
https://docs.microsoft.com/en-us/bot-framework/rest-api/bot-framework-rest-direct-line-3-0-send-activity#upload-attachments
But - I do realize that's opaque to you and other Web Chat developers, since you're a downstream consumer of this. You're just using Web Chat, which uses DirectLineJs, which uses the Rest API.
I imagine that we need to support modern phones, which are something of a moving target wrt cameras and photo file sizes.
Thanks for the help offer @andynorton :) We welcome your (and the community's) suggestions as to what this limit might be.
I think @andynorton has his point. And we need to think about an API that filter the user upload before sending it to the server.
Like an async call so dev have chances to downscale photos on JS side, or block uploads which doesn't meet some requirements.
Any updates regarding this?
And why this is marked as enhancement? I receive 500 error code from direct line when i try to upload something bigger. This should be marked as bug.
This is marked as an enhancement because it is by design.
@billba Should't there be some validation or least a place to hook in your own validation?
Receiving error and chat getting stuck* doesn't feel like by design. And there is now good way that i know to inform customer that file size was too big.
Fair enough.
From: mralnis notifications@github.com
Sent: Tuesday, February 20, 2018 8:28:19 AM
To: Microsoft/BotFramework-WebChat
Cc: Bill Barnes; Mention
Subject: Re: [Microsoft/BotFramework-WebChat] Unable to change 4MB photo upload limit (#789)
@billbahttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fbillba&data=04%7C01%7CBill.Barnes%40microsoft.com%7Ca87dd97a96ce4b7d0f1808d5787ef3e3%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636547409008296842%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-1&sdata=Rxpl3ghmI5bYIweU9d%2FbXScIAAQ9nokuDi73ORGpCEs%3D&reserved=0 Should't there be some validation or least a place to hook in your own validation?
Receiving error and chat getting stuck* doesn't feel like by design. And there is now good way that i know to inform customer that file size was too big.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMicrosoft%2FBotFramework-WebChat%2Fissues%2F789%23issuecomment-367034097&data=04%7C01%7CBill.Barnes%40microsoft.com%7Ca87dd97a96ce4b7d0f1808d5787ef3e3%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636547409008296842%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-1&sdata=voqH6BEprl7jYguUuWr1BLItPt65M%2FKy7XRBKeabdBY%3D&reserved=0, or mute the threadhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAKietwUI4zhdISQNrz5IJFzC3pekejqIks5tWvKdgaJpZM4Qi6b9&data=04%7C01%7CBill.Barnes%40microsoft.com%7Ca87dd97a96ce4b7d0f1808d5787ef3e3%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636547409008296842%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-1&sdata=7QmZhkqvnRwagE%2BohLXNTth29AhoLFg%2F6W8GDBpKK4A%3D&reserved=0.
This is annoying, my new phone camera takes 4K photos by default, the photo size goes up to 9MB easily. And there's no setting to reduce the image resolution. Please fix this. Thanks.
FWIW - here's a library that can resize the image prior to uploading: https://github.com/nodeca/pica
@danmarshall Hi Dan, we are developing a feature which allows our users to attach a media file (image, video, audio etc.) to their notes. Is there any way that we can configure the maximum file attachment size? Otherwise, the file icon on the bottom-left of webchat window will be not so helpful since most files (images, videos etc.) in current phones will exceed 4MB.
FYI, when I test the bot using Bot Emulator, it seems that it has a higher limit as I can upload 100MB files successfully.
When I upload a 16.3 MB file, the server returned 500. Looks like our server has some hard limits.
HTTP/1.1 500 Internal Server Error
Cache-Control: no-cache
Pragma: no-cache
Content-Length: 51
Content-Type: application/json; charset=utf-8
Expires: -1
Server: Microsoft-IIS/10.0
Access-Control-Allow-Origin: *
Strict-Transport-Security: max-age=31536000
Date: Mon, 08 Apr 2019 17:34:51 GMT
{
"error": {
"code": "ServiceError"
}
}
Looks like we are using the default value for attachment limit (4 MB).
I can upload a 3.999 MB file (1 KB short of 4 MB). But I cannot upload a 4 MB minus 1 byte file.
I don't think we will change this value. Will need to find a way (write a sample) for Web Chat users to upload files using their our storage, e.g. blob storage with SAS key.
Recommend to postpone to 4.5.
Hi, it's now 2020 (almost 2021). Do we have an update about file size limit now?
Most helpful comment
This is annoying, my new phone camera takes 4K photos by default, the photo size goes up to 9MB easily. And there's no setting to reduce the image resolution. Please fix this. Thanks.