How to save mp3 file name in webview with download block

Hi good people! i was trying to create my app that downloads mp3 files using web view
but every file i download it has similar name as “new file.mp3” because i set that. is there anyway i can set downloads to save the exact name of the file or saving files in different names. here are my blocks, Thanks

You could try something like this…(example is for images, modify it for mp3)

Create a global variable for example ID, set it to 0, each time you wish to save a file use join blocks

image

You could also use tinyDB to store global ID

hi i really apriciate the fact that you give me help, i tried to what you told me but as i can see your block has 3 sockets yet in my text blocks the is the one for join with 2 sockets, can you add me some more a little bit of explanation? Thanks

Click on mutator, little :gear: and add another

i did what you told me but when i download the file it is saved as 1.mp3 not the actual file name. Though Thanks for your response.
see where i have put the arrow thats how its saved

From where are you going to download mp3’s ?

from a site using web viewer

Is it your’s ? Is it allowed to download mp3’s from that site ? Post an example of a download url

its mine i created it and you can download on web though i wanted to convert it to mobile App. I didn’t want to disclose the site before.

Then depending how you store mp3’s, mayb this might help, you could adapt example for your needs