Access logs for media downloads

You can also store your URL in a table, with a timestamp and a simple object column.

Access this table through a server module and you can use anvil.server.context.client to gather data about the requester. If it were me I would mash a bunch of that data together in a hash function and add it as a string to a set in the simple object column on every request.

If either the timestamp becomes too old, or the len() of your simple object column for that URL row grows too large, the URL can be deleted from the table and the client can be prevented from getting the download link.

See the following examples of the use of context.client:

1 Like