Anvil has built-in support for uploading, storing, downloading, and manipulating files and other binary data.
There are 3 ways to work with files in Anvil:
Dynamic Files, media and other binary data (pictures, uploaded files, etc.) are represented in Anvil as Media objects. Media objects are created by Anvil APIs such as FileLoader components and the Google Drive API. You can also create them directly in Python code from byte strings or source URLs.
Media objects allow you to pass binary data between client and server code.
Static Data Files are files that you, as the app developer, can attach to your app. These files are available in your Server Modules. Static Data Files are useful for machine learning models, large datasets and data that stays constant or changes rarely.
To add Data Files to your Anvil app, click the + button in the Sidebar Menu, and select Data Files:
Do you still have questions?
Our Community Forum is full of helpful information and Anvil experts.