Error 400 - POST to upload file in bot framework emulator

Lohany Geovana Dos Santos Pereira 0 Reputation points
2024-04-22T22:19:28.8766667+00:00

I'm encountering an issue when attempting to upload large files (specifically, files of size 238MB and larger) in the Bot Framework Emulator. While smaller files are successfully uploaded and validated, attempting to upload files larger than approximately 234MB results in a 400 error with the following message:

message: "Cannot read property 'name' of undefined"

code: "ServiceError"

I've thoroughly checked my code, and it functions as expected with smaller files. However, when attempting to upload larger files, the error occurs consistently. Unfortunately, I'm unable to retrieve any error logs as the message doesn't even get sent and remains stuck in the "sending" state.

Could this issue be related to any limitations within the Bot Framework Emulator regarding file size? Or perhaps there's another aspect I might be overlooking? Any insights or suggestions on how to resolve this issue would be greatly appreciated.Captura de tela 2024-04-22 191344

Azure AI Bot Service
Azure AI Bot Service
An Azure service that provides an integrated environment for bot development.
779 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. navba-MSFT 19,735 Reputation points Microsoft Employee
    2024-04-23T03:29:35.6033333+00:00

    @Lohany Geovana Dos Santos Pereira Welcome to Microsoft Q&A Forum, Thank you for posting your query here!

    When you tested with smaller files and found it was working, What was the size of the file ?

    Please note that with direct line channel the maximum file limit is still at 4MB. See this thread from botframework repo. As per the comment on this github thread, the MaxRequestLength property of the http runtime is used by Direct Line which limits it to 4MB.

    What is the size limit of a file transferred using channels?

    Some channels have limits on the size or type of files that can be sent. For example, both Direct Line and Facebook limit activity payloads to 262,144 bytes, while the Bot Framework Emulator has no limit. Such limits are imposed by the channel. If you send a message that exceeds this limit, you may get an error, such as: The request content length exceeded limit of262,144 bytes. You can, however, provide a link to the resource as an internet attachment. For more information on sending attachments, see how to add media to messages.

    Suggestion:

    Please try deploying your Bot Framework app to Azure and then add the channels from the Azure Bot resource. Then try uploading the files from that channel.

    User's image

    .

    Please check Bot Framework General Frequently Asked Questions and Send attachment(s) by upload for more details and here.

    Reference: https://github.com/microsoft/BotFramework-DirectLineJS/issues/325

    Hope this helps. If you have any follow-up questions, please let me know. I would be happy to help.

    **

    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.