Got it… So to test this, I created an endpoint just for returning the URL of a file, so that I could call it in my browser and then copy and paste it in the same window but the same keeps happening. Based on what you’ve shared, I’m thinking now the issue might be that if I copy and paste the URL -even in the same window- I might be breaking into a new “session”. If that’s true, I’m missing how could that URL ever be called?
@anvil.server.http_endpoint('/test_get_url', methods=['GET'])
def get_file():
return app_tables.media.search()[0]['media'].url
My use case
What I’m trying to do is to serve some records to feed a third-party system on demand, but I’m trying to avoid for the file links to be permanent so that they don’t get shared using the URL (they should be used once to download the files when the record is served)
Based on what Meredydd said in the original post, I understood this is the intended use case of those links.
I am also puzzled by @campopianoa’s demonstration not working, I’m assuming it worked at some point but looking at why it isn’t working at the moment, it’s because it’s encountering the same issue
I think I’m going to have to code a function that produces temporary links, I was hoping to avoid that with the use of media URLs.
Many thanks for the help @jshaffstall !! Really appreciate it