Closed AyandaSabasaba closed 7 years ago
How big is the file? It seems you will not be able to send it because it is too large like the error message says. Are you able to break it up into smaller files and send them?
There are options such has storing the file in azure blob and send the download URL to the bot user. I was looking for some suggestions around that like streaming bits and bits of bytes
I really think hosting the file somewhere and providing the download link is the best solution here.
Security is my issue it's sensitive information contained in the file, serialising the file on the fly is more secured than providing a link
@AyandaSabasaba Did you try to send attachments in Skype (i mean files).
I am trying to send a PDF smaller than 256Kb encoded to base64 and it does not work. Is there another way to send PDF file without storing and sending the URL? I see this option in the documentation.Is it the same thing that send data URI?
@gcfabri are you trying to send the file from the bot or from the user? Also what channel are you trying this on?
@JasonSowers From bot to the user and I am using Botkit + BotFramework (Facebook, Telegram, Web and Skype). I think I've settled my doubt, the file I was trying to send is smaller than 256kB indeed, however the size of the base64 string exceeds the limit, resulting in an error: 'Bad Request'. In my case, the workaround was store the files and send only the URI to the user.
Glad you were able to work around this
I get this same error when talking to the Bot in WebChat. I don't get the error in MS Teams. Are the limits different for each client? What is the recommend response message size and how do you check it correctly? The error occurs when giving back a Carousel with max 10 items, which I believe is the max size.
PS: It works with max 5 carousel items. Still, it's not cool that these limits are different for each client
Updating just out of curiosity, I also only have the error on the webchat, on teams the error doesn't happen.
The reason this happens is bot framework does not control the limits the client/channel imposes on file transfers. If you are having a problem with any channel check that channel's documentation. Bot framework/Microsoft is not able to tell Facebook messenger's client what to do, Facebook's developers do, or whatever channel. If the problem is with WebChat file an issue against the WebChat repository.
Let me answer the obvious questions here, well if teams it a Microsoft product why is it different then?
Microsoft is a gigantic global organization with a lot of employees. It's easy to make the assumption that everyone at Microsoft works for the same leadership in the same organization in the same room and everything should just work together seamlessly. So, the Teams team and the bot framework team are not working side by side making sure 100% of things are in lockstep. Products also change things, and not everyone is able to keep up to date with every single change happening for all of Microsoft's offerings. Teams probably has a reason they didn't make the file size limit the same as WebChat. Just like you wouldn't expect an AWS developer to know why your Amazon package is late.
Hi, what should be the size limit in sending attachments from bot to user for MS teams? Can't find the documentation for it.
I have my bot hosted in Azure app services, I have a large pdf document I am sending through to the user When the bot sends the message with the attachment: Throws an exception : Microsoft.Rest.HttpOperationException: The request content length exceeded limit of 262144 bytes
var attachmentData = Convert.ToBase64String(File.ReadAllBytes(HttpContext.Current.Server.MapPath("~/App_Data/Test2.pdf"));
Please help.