After uploading a file into the anvil table, I need to get its url so that the users can download it but cannot find a way.
Help is greatly appreciated.
After uploading a file into the anvil table, I need to get its url so that the users can download it but cannot find a way.
Help is greatly appreciated.
Off the top of my head, if the file is a media object, it should be able to be passed directly to the client and then the client-side download()
function will download it. Will that work for you?
Thanks, it is actually a mp3 file, so the url is required to play it
Do you mean you want to play it as soon as it is clicked? That is, you actually do not want to download it as stated above?
If so, see this post:
Also, you mentioned needing the URL. If it is a media object the url()
method will return the url.
Brilliant, many thanks @alcampopiano, the url() works like a charm. Much simple than I think.
I want to download, play it and use the url for many other purposes.