Live Chat

We'll need to share your messages (and your email address if you're logged in) with our live chat provider, Drift. Here's their privacy policy.

If you don't want to do this, you can email us instead at

Uploading and downloading files

Are you new here?

Anvil is a tool for building full-stack web apps with nothing but Python and a drag-and-drop designer. Learn more on our website, or sign up and try it yourself -- it's free!


Files can be loaded into the browser using the FileLoader component.

To upload them to the back-end, simply pass the FileLoader’s file property as an argument to a server function.

The uploaded file will be a Media object. These can be stored directly in the Data Tables in a Media column.


To download a Media object from client code, run


where media_obj is the Media object.

The Media object can be retrieved from Data Tables in the same way as you would a string, integer or other data type.

When the Media object is retrieved, it will still be a Media object; its format does not change from when it was originally loaded into the browser.

You can also create a download button with a Link. Media objects have a url property containing a URL that the user can access to download the file. Set this as a Link component’s url to give the user a clickable link that downloads the file. You can also automatically redirect the user to this URL as you would any other.