Hi @Sangarsh S,
Thank you for reaching out to Microsoft Q&A forum!
It seems like you're encountering a 400 error when uploading a file through the Bot Framework, even though the file size is under the limit. A possible cause for the error could be related to how the bot is handling the uploaded file in the on_message_activity
method.
Check to ensure that the bot is correctly processing the attachment and that the file upload URL is properly configured. Additionally, verify that the file type is supported (in your case, a PDF) and that the bot has the necessary permissions to handle file uploads. Sometimes, if the attachment is not correctly formatted or there is an issue with the connection to the server, the request might be rejected with a 400 error.
You may also want to inspect the actual response message or logs from the Bot Framework to get more details about what caused the error. This could reveal issues like invalid request data, unsupported file formats, or problems in the code that processes the attachment. Debugging the request and checking the headers, body content, and the URL endpoint for uploading the file might help in pinpointing the issue.
Lastly, double-check that you are using the correct bot endpoint in the Bot Framework Emulator, and ensure it's aligned with what your code expects.
Please look into: Bot Framework and Create a bot with the Bot Framework SDK
Thank you.