botpress / v12

Botpress OSS – v12
https://v12.botpress.com
GNU Affero General Public License v3.0
82 stars 90 forks source link

[BUG]: Node transition failing after file upload #1384

Open Michael-N-M opened 3 years ago

Michael-N-M commented 3 years ago

Description After a user uploads a file using choice skill, the chatbot does not transition to the next node. When testing this in the studio interface using the emulator, the studio UI goes blank after file upload.

To Reproduce Steps to reproduce the behavior:

  1. Create a choice skill which returns either BOTPRESS.FILE_UPLOAD or BOTPRESS.IMAGE_UPLOAD
  2. Link it to some nodes
  3. Chat with the bot and upload a file
  4. No transition after file upload

Expected behavior A clear and concise description of what you expected to happen.

Screenshots image

Environment (please complete the following information):

Additional context Conversation with the chatbot e.g., thanking a user should continue after file upload

tomkcey commented 3 years ago

@Michael-N-M For me this is working properly. Look at this screenshot for reference: Screenshot from 2021-11-01 11-59-33

codeilm commented 2 years ago

@Michael-N-M For me this is working properly. Look at this screenshot for reference: Screenshot from 2021-11-01 11-59-33

How to use the uploaded image in conversation?

I want to send the image to server using API.

Johna5821 commented 1 year ago

@codeilm Did you get this?

How to use the uploaded image in conversation?

I want to send the image to server using API.

vamsi2449 commented 1 year ago

@Johna5821 I have same requirement

How to use the uploaded image in conversation?

I want to send the image to server using API.

Aram-Osipyan commented 7 months ago

@vamsi2449 @Johna5821 your uploaded file is located in event.payload.url, so you can use it to send it via formData for example:

  let data = new FormData()
  data.append('proof_image', fs.createReadStream(event.payload.url))
  let config = {
    method: 'post',
    maxBodyLength: Infinity,
    url: '<url>',
    headers: {
      ...data.getHeaders()
    },
    data: data
  }
  const resp = (await axios.request(config)).data