D
D
demon202015-02-16 10:47:13
Android
demon20, 2015-02-16 10:47:13

Android webview DownloadManager how to correctly determine the name and type of the downloaded file?

android webview
_ for example, we have a link Those. if you click on the specified link, you need to get its value = Yandex as a result, or please tell me how to determine the name and extension of the downloaded file if the link to the file is not direct , for example in the form - after clicking on the specified link, the file is downloaded immediately. When I download such a file with the DownloadManager class connected to the webview application, the file is downloaded with the name file.php, I can’t get the real file name - file.xls <a href="ya.ru">Яндекс</a>
<a href="/download/file.php?id=5158">файл.xls</a>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Egor Kazantsev, 2015-02-17
@saintbyte

Try playing on the other side - php
Add something like this to file.php:

header('Content-Disposition: inline; filename="July Report.pdf"');.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question