K
K
kolomiec_artiom2020-01-29 14:18:59
Python
kolomiec_artiom, 2020-01-29 14:18:59

How to change the name of a downloaded file that is located on a different server?

Good afternoon! I have a link to another site where you can download the file:

hb.hb/123123121.mp3

I would like it to change its name to the one I need when downloading. Can this be done somehow?

I'm ready to redirect from my site, but I don't know how to do it correctly. Because if you just write:
<a href="hb.hb/123123121.mp3" download="Norm.nazvanie" style="background: #AFA">save</a>


Then he just goes to that page and for downloading you still need to click on another button and the download happens with the name "hb.hb/123123121.mp3"

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dmitry Shitskov, 2020-01-29
@kolomiec_artiom

Example for flask
izmailoff.github.io/web/flask-file-streaming
Example # Download from provided URL.

D
Dmitry Kim, 2020-01-29
@kimono

If you get the contents of this file, you can send this file to the client from your server with any name.

K
Karpion, 2020-01-29
@Karpion

Looking for a tutorial on HTML. We are looking for the chapter " tag A " there . We read the attributes, we find the attribute "download= filename ". Testing.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question