0

this is the code i wrote:

<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>title</title>
</head>

<body>
    <a href="test.txt" download="hi">Click to download!</a>
</body>

</html>

when I click on the text I it doesnt download the file and it only previews it instead of downloading Can you write me a proper code ? thanks

1 Answers1

1

You are asking for pdf file and in link txt file is given..

anyways.. no prob...

try

  <a href="test.txt" target='_blank' download>Click to download!</a>