microsoft / botframework-sdk

Bot Framework provides the most comprehensive experience for building conversation applications.
MIT License
7.48k stars 2.44k forks source link

[Node.js SDK, WebChat] How can I trigger a file upload window? #3970

Closed dividor closed 5 years ago

dividor commented 6 years ago

Bot Info

Issue Description

We have a bot which is used to raise support issues. Some support issues will have files to be attached - screenshots, log files - but not ALL issues. Right now we have a workflow like this:

  1. "Do you want to upload an attachment?"
  2. If Yes - builder.Prompts.attachment - "Please click on the image icon on the left to upload attachment"
  3. User clicks image icon on left of input box
  4. File chooser window pops up, user chooses file, it's uploaded

The thing is, this is a bit cumbersome with a step too many. What we really want is ...

  1. "Do you want to upload an image/attachment?"
  2. If Yes - File chooser window pops up, user chooses file, file is uploaded

We already know they want to upload something, so don't need to prompt them again.

Is there a way to prompt the file chooser window to pop up immediately?

dividor commented 6 years ago

Any update on this please, do you need further information?

FranciscoPonceGomez commented 6 years ago

Hi @dividor,

Can't you just hook up the file chooser event with the "yes" intent? I think I might be missing something. Can you share some code?

dividor commented 6 years ago

Hi @FranciscoPonceGomez,

Here is how I am asking the person if they want to upload a file ....

bot.dialog('uploadFile', [
    function (session, args, next) {
          builder.Prompts.confirm(session, "Do you want to upload a file?");
     },
     function (session, args) {
          if (args.response) {
             builder.Prompts.attachment(session, "Upload a picture");
          else {
             session.send("OK then, we won't");
     }
]);

So after the user confirms "yes", they get a prompt to upload a file, which means they have to click on the file image before a file chooser appears. We want the file choose to appear immediately after they say "yes".

fanidamj-zz commented 6 years ago

Can you please let us know if the issue still persists?

dividor commented 5 years ago

It is still an issue for me, unless there is some solution I'm unaware of

EricDahlvang commented 5 years ago

@dividor This drag/drop example should point you in the right direction: https://stackoverflow.com/questions/50581375/trigger-bot-with-drag-drop-sharepoint-online

JasonSowers commented 5 years ago

Thank you for opening an issue against the Bot Framework SDK v3. As part of the Bot Framework v4 release, we’ve moved all v3 work to a new repo located at https://github.com/microsoft/botbuilder-v3. We will continue to support and offer maintenance updates to v3 via this new repo.

From now on, https://github.com/microsoft/botbuilder repo will be used as hub, with pointers to all the different SDK languages, tools and samples repos.

As part of this restructuring, we are closing all tickets in this repo.

For defects or feature requests, please create a new issue in the new Bot Framework v3 repo found here: https://github.com/microsoft/botbuilder-v3/issues

For Azure Bot Service Channel specific defects or feature requests (e.g. Facebook, Twilio, Teams, Slack, etc.), please create a new issue in the new Bot Framework Channel repo found here: https://github.com/microsoft/botframework-services/issues

For product behavior, how-to, or general understanding questions, please use Stackoverflow. https://stackoverflow.com/search?q=bot+framework

Thank you.

The Bot Framework Team