Upload Files from a Page
Add a native File Input to a compact responsive page, configure a private upload endpoint, validate file types and size, and verify storage.
Watch tutorial (9:12)
Add a native File Input to a compact responsive page, configure a private upload endpoint, validate file types and size, and verify storage.
Watch tutorial (9:12)
Add file uploads to a page and connect the upload to your application.
Recorded with an earlier Twidget interface. Names, control locations and available options may differ; use the linked documentation for current guidance.
Watch tutorial (3:11)This documentation describes the functionality available in Twidget for uploading files through a generated API endpoint and managing interactions via pages. The process allows developers to create dynamic forms that enable users to upload files directly to the backend file storage, specifying various parameters such as storage path and access permissions.
The primary goal of the file upload feature is to streamline the integration of file management into applications built on the Twidget platform, allowing for seamless data handling without the need for extensive coding. It simplifies the user experience by providing an intuitive interface for file uploads.
File Endpoint Generation: Developers can create specific endpoints to handle file uploads, enabling CRUD operations on files stored on the server.
Dynamic Form Handling: The incorporation of forms with file inputs allows users to select and upload files easily. Forms can be linked to specific actions triggered upon submission.
File Permissions: Users can specify upload permissions (public or private) to control access to uploaded content.
Endpoint Creation: A specific upload endpoint is generated which accepts files and metadata (e.g., storage path, filename, permissions).
Page and Form Setup: Within the Twidget pages tab, a new page is created that houses a form element containing a file input field and a submit button to initiate the upload process.
Function Definition: Developers create a function that constructs and sends an HTTP request to the upload endpoint, configured to handle file data as form data.
Action Linkage: The form is configured to trigger the upload function upon submission, managing the lifecycle of the file upload.
Testing and Validation: Users can test the integration by selecting a file and submitting the form, followed by confirming the upload in the file manager interface.
This process combines frontend form elements and backend API capabilities, enabling effective file management in Twidget-applications.
Page tables
Use a Table element to show a list of records with search, sortable headings and paging. Choose an existing Table page creation option, add a Table element in the editor, or start with a [Page starter](/docs/pages/page-starters). Find the right element. Select the table on the canvas or in Layers. T...
Access Query Parameters in a Page
This section details how to access and utilize query parameters within Twidget pages, enabling dynamic content and functionality based on user-supplied parameters. Key Concepts. - Query Parameters: A method to pass data to web pages through the URL, enabling dynamic content updates based on user int...
Page Components
Page components are reusable building blocks within the Twidget platform that enhance development efficiency by allowing users to create, manage, and implement consistent UI elements across multiple pages. They serve to encapsulate functionality and design into a single entity, which can be reused a...
Layout Controls
Layout controls are essential components in Twidget, allowing developers to manage the visibility and behavior of various layout elements, such as modals and drawers, within a user interface. These controls enable dynamic user interactions by facilitating the opening, closing, and toggling of layout...
Element Actions
Element actions in Twidget are integral commands that can be assigned to user interface elements, enabling interactivity within applications. The actions are defined to respond to user inputs, primarily through triggering events associated with specific elements. Purpose of Element Actions. Element ...