FileOutput
File output widget for displaying downloadable files.
Examples
Basic Usage
This example runs a form with a single page containing the widget for selecting .xlsx files
Example Code
from abstra.forms import FileOutput, run
# Create a page with the widget
example_page = [
FileOutput(
"https://http.cat/status/200.jpg",
download_text="Click here to download the image",
)
]
# Run the form
result = run([example_page])
# Print the result
print(result)
Parameters
Name | Description | Type | Default |
---|---|---|---|
file (required) | The file to make available for download, as a URL or file-like object. | Union[str, io.IOBase] | None |
download_text | Text displayed on the download button. | str | 'Download' |
full_width | Whether the download button should take up the full width of its container. | bool | False |