https://discord.gg/botpress logo
How to Display Image Upload Dialog in Botpress Clo...
# 🤝help
b
Hi team, I’m currently migrating a bot from Botpress v12 to Botpress Cloud. In the Botpress v12, I was able to successfully trigger the file upload dialog using BOTPRESS.FILE_UPLOAD. However, I’d like the bot to prompt the user specifically for an image upload, ideally showing an image picker dialog or restricting accepted file types to images (e.g., .jpg, .png). Is there a way in Botpress Cloud to trigger an image-only upload dialog, or to validate uploaded files to ensure they are images? Any suggestions or examples would be highly appreciated. Thanks in advance!
p
You can absolutely use an execute code card to look at the extension the uploaded file has and display a message based on whether or not it's an image. Hope this helps!
b
Thank you for your quick updates! Highly appreciate it! I need the file upload dialog to display automatically based on the user's response. I am currently using a Single Picker (Yes/No). If the user selects "Yes", the bot should immediately trigger and display the image upload dialog. Could you please provide more detailed guidance on how to implement this stuff? Thank you for yoursupport.
p
I'm not sure what you mean by image upload dialog?
b
Let's say just File Upload Dialog.
p
I'm still confused if you want to write text to indicate the user should upload an image you can but that will not impact the user's ability to upload a file at any point of the conversation if you have enabled file upload. A user simply needs to click the plus button (on webchat): https://cdn.discordapp.com/attachments/1392564477026898073/1392570609850126418/Screenshot_2025-07-09_at_2.18.18_PM.png?ex=687003f2&is=686eb272&hm=7418f6547b0b593051b89f4f37bac2b7fad68ec39894ee7b92960258eee9216b&
p
I believe you can do this, but only if you implement Webchat using our React library: https://botpress.com/docs/webchat/react-library/components/composer#param-upload-file You would have to build a custom Webchat UI using React, and then build in logic that would display the "Upload file" button.
b
@prehistoric-airplane-85682 , Thank you so much! That is pretty helpful. Lovely
p
Happy to help!
2 Views