Upload

You can add an Upload element in your data app for your end users to upload files. The files end users uploaded will be saved in your media files in Resources. You can then load the files to databases, or use them in machine learning use cases.

Properties

Form item name: This is the name that the encompassing form will use to access the output of the checkbox. See Custom Form for how it's used.

Path: Select the directory path where the uploaded files will be stored in media folders.

Public URL: This property specifies the public URL where the uploaded files can be accessed. It is essential for retrieving and displaying the files to end users.

Multiple: Whether or not allow user to upload multiple files.

Allow extensions: This property determines which file types are allowed for upload. Extensions should be listed and separated by commas, e.g., png,jpeg,gif.

Max File Size: This defines the maximum size for uploaded files, measured in kilobytes (KB). Setting this to 0 may allow files of any size, depending on server configurations.

Example: Load User uploaded CSV files to PostgreSQL

Combining Upload and the Load CSV To Postgres API, you can build service for users to upload csv and preview them. This example serves as one of our template Upload CSV template, which you can find in the app builder.

  1. Add An Upload element

  2. Select event Upload Successfully

  3. (Optional) Use Generate Unique ID to get a table name and save it in app data

  4. Add the "Load CSV To Postgres" action. Use the path of the first uploaded file as the Path parameter.

  5. (Optional) Add a "Set Text" action to display a message indicating whether the operation was successful.

Last updated