Allow users to upload files
Last updated
Last updated
Having the ability for users to upload files can be an essential functionality for many AI applications. Whether it's allowing users to upload a report, a contract, or homework, integrating this feature can provide a richer interaction experience. This tutorial will walk you through enabling file uploads in your Stack AI application.
Make sure you're logged into Stack AI.
Have a project ready, or create a new project where you'd like to allow file uploads.
To begin the process, you must integrate a mechanism to handle file uploads.
Navigate to the Data Loaders section.
Select the Document
data loader.
Go to the data loader settings.
Inside the Document settings, find the option labeled expose in interface
.
Toggle or check this option to enable it.
To reflect the changes and make the upload feature active:
Navigate to the project builder.
Click on the Publish
button or its equivalent. This action will save and deploy your project with the new changes.
Export your chatbot or form to make it available on various platforms.
From the builder, click on the Export
option.
Choose whether you want to export as a Chatbot
or a Form
.
To handle the incoming file data properly, configure the input settings:
In the export configuration, navigate to the inputs/outputs
section.
Here, find the option related to the document node
.
Enable this node as an input
. This ensures that the chatbot or form can accept file uploads from users.
Follow the additional steps to export the project.
Congratulations! You've now successfully integrated file upload functionality into your chatbot. Test the feature to ensure everything works as expected, and make any necessary adjustments.