BotFramework-WebChat icon indicating copy to clipboard operation
BotFramework-WebChat copied to clipboard

Unable to change 4MB photo upload limit

Open andynorton opened this issue 9 years ago • 29 comments

In WebChat, the limit for “Images” is set to 4MB. This is problematic when using phone cameras to upload images for processing.

andynorton avatar Nov 18 '17 07:11 andynorton

I don't think that limit is set by WebChat.

billba avatar Nov 18 '17 17:11 billba

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?

danmarshall avatar Nov 18 '17 17:11 danmarshall

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.

andynorton avatar Nov 18 '17 17:11 andynorton

Seriously, the limit is not set by WebChat.

billba avatar Nov 18 '17 19:11 billba

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?

andynorton avatar Nov 18 '17 19:11 andynorton

Please see my comment above

danmarshall avatar Nov 18 '17 22:11 danmarshall

Hi @danmarshall - Conversation ID: AphyPzEXUHlJlBQclkCiqD. We've submitted 3 images under 4MB and 3 over.

andynorton avatar Nov 19 '17 04:11 andynorton

@danmarshall - is that Conversation ID of any use?

andynorton avatar Nov 26 '17 15:11 andynorton

Hello @andynorton - there was an error reading the multipart MIME body. Can you please share a file which causes the issue?

danmarshall avatar Nov 27 '17 18:11 danmarshall

Hi @danmarshall - https://1drv.ms/i/s!AkI2BTKSRBbJhLpiIFwFrV-a3z1LAQ

An image over 4mb should cause the issue in our testing.

andynorton avatar Nov 27 '17 18:11 andynorton

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.

danmarshall avatar Nov 27 '17 21:11 danmarshall

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?

andynorton avatar Nov 27 '17 21:11 andynorton

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.

danmarshall avatar Nov 27 '17 21:11 danmarshall

Thanks for the help offer @andynorton :) We welcome your (and the community's) suggestions as to what this limit might be.

danmarshall avatar Nov 27 '17 21:11 danmarshall

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.

compulim avatar Dec 11 '17 18:12 compulim

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.

mralnis avatar Feb 19 '18 14:02 mralnis

This is marked as an enhancement because it is by design.

billba avatar Feb 20 '18 15:02 billba

@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.

  • Stuck - stopping the chat flow until you type something else.

mralnis avatar Feb 20 '18 16:02 mralnis

Fair enough.


From: mralnis [email protected] 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.

  • Stuck - stopping the chat flow until you type something else.

— 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.

billba avatar Feb 20 '18 17:02 billba

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.

HainanZhao avatar Apr 05 '18 04:04 HainanZhao