B
B
BigSmoke2017-01-06 15:19:00
PHP
BigSmoke, 2017-01-06 15:19:00

How to get the file name from a link like site.ru/engine/download.php?id=236?

Hello!
On the page of the site on the DLE engine there is a link to the .rar archive of the form site.ru/engine/download.php?id=236.
When you click on this link, the download of the archive begins, the name of which, for example, is bugaga.rar.
How to get the name of this archive (bugaga.rar) in php?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
Wexter, 2017-01-06
@BigSmoke

See the Content-Disposition header in the server response, it usually looks like Content-Disposition: attachment; filename=bugaga.rar

J
Jony1337, 2017-01-06
@Jony1337

Well, if the id of the bugaga.rar file is 236, for example, then what is the question, does it come from the database or what?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question