Download media after Background tasks ends

If you are on the free plan and wish to workaround the 30 seconds limitation, this may be the beginning of a path to the simplest solution, as @stefano.menci said.

Here is a link to another question about how to store files in a data table, where I made them a clone link to see an example of how it works.

Edit:
Once you have it in a data table and working, you could:

  1. Use uplink as you have suggested. You don’t actually HAVE to run uplink as anvil.server.run_forever() as the docs suggest. You could
  2. Run a while loop with a time.sleep() function that checks your anvil data table for a file to process every 5 seconds or so, then
  3. does that work that takes longer than 30 seconds, and
  4. returns it marking it as done in a bool column of the table. You could then
  5. set a timer component on your anvil app to check to see if the file is done and
  6. create the link to the data table for the user on the anvil form.

Edit 2:
Forgot to add this about background tasks:
Here is a link to another cloneable example app I created that is about a different topic (async components) but shows off working background tasks quite nicely.