Implementing a chatbot using FB Messenger with file upload functionality in Bluemix












0















We are implementing a chatbot using FB Messenger. One of their requirements is that the customer have set of guides, documents (PDF, DocX), which they want to store in IBM Cloud. Whenever user asks for download of a guide then the chatbot should provide a link to the file, on clicking of which the file contents should be opened in a new window.
Customer also has a requirement that their admin users should be provided a provision via Admin UI to upload new set of guides in future.



We are using Node.JS application. We are working on an approach of storing all the guides, documents within the Node.JS app and provide a relative location to those files in the chat interface.



We are adding files as static component:



'use strict';

var express = require('express');

app.use(express.static('./public'));


Then changing chat output string to have document URL to open it in new window successfully.



We want to upload the files as that's the requirement that user would like to upload the files through a UI in future.



Please provide pointers on uploading files as static components into the running application.










share|improve this question





























    0















    We are implementing a chatbot using FB Messenger. One of their requirements is that the customer have set of guides, documents (PDF, DocX), which they want to store in IBM Cloud. Whenever user asks for download of a guide then the chatbot should provide a link to the file, on clicking of which the file contents should be opened in a new window.
    Customer also has a requirement that their admin users should be provided a provision via Admin UI to upload new set of guides in future.



    We are using Node.JS application. We are working on an approach of storing all the guides, documents within the Node.JS app and provide a relative location to those files in the chat interface.



    We are adding files as static component:



    'use strict';

    var express = require('express');

    app.use(express.static('./public'));


    Then changing chat output string to have document URL to open it in new window successfully.



    We want to upload the files as that's the requirement that user would like to upload the files through a UI in future.



    Please provide pointers on uploading files as static components into the running application.










    share|improve this question



























      0












      0








      0








      We are implementing a chatbot using FB Messenger. One of their requirements is that the customer have set of guides, documents (PDF, DocX), which they want to store in IBM Cloud. Whenever user asks for download of a guide then the chatbot should provide a link to the file, on clicking of which the file contents should be opened in a new window.
      Customer also has a requirement that their admin users should be provided a provision via Admin UI to upload new set of guides in future.



      We are using Node.JS application. We are working on an approach of storing all the guides, documents within the Node.JS app and provide a relative location to those files in the chat interface.



      We are adding files as static component:



      'use strict';

      var express = require('express');

      app.use(express.static('./public'));


      Then changing chat output string to have document URL to open it in new window successfully.



      We want to upload the files as that's the requirement that user would like to upload the files through a UI in future.



      Please provide pointers on uploading files as static components into the running application.










      share|improve this question
















      We are implementing a chatbot using FB Messenger. One of their requirements is that the customer have set of guides, documents (PDF, DocX), which they want to store in IBM Cloud. Whenever user asks for download of a guide then the chatbot should provide a link to the file, on clicking of which the file contents should be opened in a new window.
      Customer also has a requirement that their admin users should be provided a provision via Admin UI to upload new set of guides in future.



      We are using Node.JS application. We are working on an approach of storing all the guides, documents within the Node.JS app and provide a relative location to those files in the chat interface.



      We are adding files as static component:



      'use strict';

      var express = require('express');

      app.use(express.static('./public'));


      Then changing chat output string to have document URL to open it in new window successfully.



      We want to upload the files as that's the requirement that user would like to upload the files through a UI in future.



      Please provide pointers on uploading files as static components into the running application.







      ibm-cloud ibm-cloud-infrastructure ibm-cloud-tools ibm-cloud-functions






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 31 '18 at 2:37







      prashanthmadduri

















      asked Dec 28 '18 at 16:39









      prashanthmadduriprashanthmadduri

      34




      34
























          1 Answer
          1






          active

          oldest

          votes


















          1














          Have you given this a read: http://upkarlidder.com/blog/posts/2017/bluemix-simple-static-site.html



          Or this one: https://www.ibm.com/blogs/bluemix/2014/08/deploying-static-web-sites/



          Nodejs magic to serve static site



          app.use(express.static(__dirname + '/public'));


          That single line in your app.js tells node.js where to fetch the static files from. You can just place your static site in the public directory and publish back to Bluemix using the next step






          share|improve this answer


























          • the snippet provided is a copy from one of the links.

            – Rohit Shetty
            Dec 30 '18 at 20:49











          • The links are from IBM and should be around long enough any way - so shouldnt be an issue.

            – Rohit Shetty
            Dec 30 '18 at 20:49











          • Thank You Rohit for your inputs. Could you please provide pointers on uploading files through UI into the cloud running application as static components.

            – prashanthmadduri
            Dec 31 '18 at 2:51











          • Prashanth, you should use object store. See altoros.com/blog/…

            – Rohit Shetty
            Dec 31 '18 at 4:44











          • Thanks Rohit, does this Object storage is the only solution here, instead, can we directly upload the files into application's '/public' folder of cloud running application and retrieving whenever required.

            – prashanthmadduri
            Jan 1 at 2:34











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53961618%2fimplementing-a-chatbot-using-fb-messenger-with-file-upload-functionality-in-blue%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          Have you given this a read: http://upkarlidder.com/blog/posts/2017/bluemix-simple-static-site.html



          Or this one: https://www.ibm.com/blogs/bluemix/2014/08/deploying-static-web-sites/



          Nodejs magic to serve static site



          app.use(express.static(__dirname + '/public'));


          That single line in your app.js tells node.js where to fetch the static files from. You can just place your static site in the public directory and publish back to Bluemix using the next step






          share|improve this answer


























          • the snippet provided is a copy from one of the links.

            – Rohit Shetty
            Dec 30 '18 at 20:49











          • The links are from IBM and should be around long enough any way - so shouldnt be an issue.

            – Rohit Shetty
            Dec 30 '18 at 20:49











          • Thank You Rohit for your inputs. Could you please provide pointers on uploading files through UI into the cloud running application as static components.

            – prashanthmadduri
            Dec 31 '18 at 2:51











          • Prashanth, you should use object store. See altoros.com/blog/…

            – Rohit Shetty
            Dec 31 '18 at 4:44











          • Thanks Rohit, does this Object storage is the only solution here, instead, can we directly upload the files into application's '/public' folder of cloud running application and retrieving whenever required.

            – prashanthmadduri
            Jan 1 at 2:34
















          1














          Have you given this a read: http://upkarlidder.com/blog/posts/2017/bluemix-simple-static-site.html



          Or this one: https://www.ibm.com/blogs/bluemix/2014/08/deploying-static-web-sites/



          Nodejs magic to serve static site



          app.use(express.static(__dirname + '/public'));


          That single line in your app.js tells node.js where to fetch the static files from. You can just place your static site in the public directory and publish back to Bluemix using the next step






          share|improve this answer


























          • the snippet provided is a copy from one of the links.

            – Rohit Shetty
            Dec 30 '18 at 20:49











          • The links are from IBM and should be around long enough any way - so shouldnt be an issue.

            – Rohit Shetty
            Dec 30 '18 at 20:49











          • Thank You Rohit for your inputs. Could you please provide pointers on uploading files through UI into the cloud running application as static components.

            – prashanthmadduri
            Dec 31 '18 at 2:51











          • Prashanth, you should use object store. See altoros.com/blog/…

            – Rohit Shetty
            Dec 31 '18 at 4:44











          • Thanks Rohit, does this Object storage is the only solution here, instead, can we directly upload the files into application's '/public' folder of cloud running application and retrieving whenever required.

            – prashanthmadduri
            Jan 1 at 2:34














          1












          1








          1







          Have you given this a read: http://upkarlidder.com/blog/posts/2017/bluemix-simple-static-site.html



          Or this one: https://www.ibm.com/blogs/bluemix/2014/08/deploying-static-web-sites/



          Nodejs magic to serve static site



          app.use(express.static(__dirname + '/public'));


          That single line in your app.js tells node.js where to fetch the static files from. You can just place your static site in the public directory and publish back to Bluemix using the next step






          share|improve this answer















          Have you given this a read: http://upkarlidder.com/blog/posts/2017/bluemix-simple-static-site.html



          Or this one: https://www.ibm.com/blogs/bluemix/2014/08/deploying-static-web-sites/



          Nodejs magic to serve static site



          app.use(express.static(__dirname + '/public'));


          That single line in your app.js tells node.js where to fetch the static files from. You can just place your static site in the public directory and publish back to Bluemix using the next step







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Dec 30 '18 at 20:48

























          answered Dec 30 '18 at 17:37









          Rohit ShettyRohit Shetty

          435210




          435210













          • the snippet provided is a copy from one of the links.

            – Rohit Shetty
            Dec 30 '18 at 20:49











          • The links are from IBM and should be around long enough any way - so shouldnt be an issue.

            – Rohit Shetty
            Dec 30 '18 at 20:49











          • Thank You Rohit for your inputs. Could you please provide pointers on uploading files through UI into the cloud running application as static components.

            – prashanthmadduri
            Dec 31 '18 at 2:51











          • Prashanth, you should use object store. See altoros.com/blog/…

            – Rohit Shetty
            Dec 31 '18 at 4:44











          • Thanks Rohit, does this Object storage is the only solution here, instead, can we directly upload the files into application's '/public' folder of cloud running application and retrieving whenever required.

            – prashanthmadduri
            Jan 1 at 2:34



















          • the snippet provided is a copy from one of the links.

            – Rohit Shetty
            Dec 30 '18 at 20:49











          • The links are from IBM and should be around long enough any way - so shouldnt be an issue.

            – Rohit Shetty
            Dec 30 '18 at 20:49











          • Thank You Rohit for your inputs. Could you please provide pointers on uploading files through UI into the cloud running application as static components.

            – prashanthmadduri
            Dec 31 '18 at 2:51











          • Prashanth, you should use object store. See altoros.com/blog/…

            – Rohit Shetty
            Dec 31 '18 at 4:44











          • Thanks Rohit, does this Object storage is the only solution here, instead, can we directly upload the files into application's '/public' folder of cloud running application and retrieving whenever required.

            – prashanthmadduri
            Jan 1 at 2:34

















          the snippet provided is a copy from one of the links.

          – Rohit Shetty
          Dec 30 '18 at 20:49





          the snippet provided is a copy from one of the links.

          – Rohit Shetty
          Dec 30 '18 at 20:49













          The links are from IBM and should be around long enough any way - so shouldnt be an issue.

          – Rohit Shetty
          Dec 30 '18 at 20:49





          The links are from IBM and should be around long enough any way - so shouldnt be an issue.

          – Rohit Shetty
          Dec 30 '18 at 20:49













          Thank You Rohit for your inputs. Could you please provide pointers on uploading files through UI into the cloud running application as static components.

          – prashanthmadduri
          Dec 31 '18 at 2:51





          Thank You Rohit for your inputs. Could you please provide pointers on uploading files through UI into the cloud running application as static components.

          – prashanthmadduri
          Dec 31 '18 at 2:51













          Prashanth, you should use object store. See altoros.com/blog/…

          – Rohit Shetty
          Dec 31 '18 at 4:44





          Prashanth, you should use object store. See altoros.com/blog/…

          – Rohit Shetty
          Dec 31 '18 at 4:44













          Thanks Rohit, does this Object storage is the only solution here, instead, can we directly upload the files into application's '/public' folder of cloud running application and retrieving whenever required.

          – prashanthmadduri
          Jan 1 at 2:34





          Thanks Rohit, does this Object storage is the only solution here, instead, can we directly upload the files into application's '/public' folder of cloud running application and retrieving whenever required.

          – prashanthmadduri
          Jan 1 at 2:34


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53961618%2fimplementing-a-chatbot-using-fb-messenger-with-file-upload-functionality-in-blue%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Monofisismo

          Angular Downloading a file using contenturl with Basic Authentication

          Olmecas