0

I am trying to create a link to file from html page but the problem is the file name is not gonna be same every time. For example the file name could be Filename_11.txt, Filename_12.txt, Filename_xx.txt etc. I have tried using * with the file name but it did not work.

<a href="FileDirectory/Filename_*.txt">Click to open file</a>
  • There's no way to pass a wildcard to a server that I am aware of-- you are probably going to have to figure out different way. Perhaps you can fetch the path dynamically from an endpoint, or try to generate it before serving the HTML to the server. – Alexander Nied May 11 '22 at 16:23
  • Just use javascript? ^^ – Taki7o7 May 11 '22 at 19:17
  • Also, where you create this anker/s? Is it one per page? Or do you want to generate one for each file in a directory? Depending on what exactly you want, the solution can vary very much. Or it could even be impossible with "tools" you work with. So you should be more specific and give us more information in order to help you – Taki7o7 May 11 '22 at 19:21
  • For my requirement, at a time only one of these files Filename_11.txt or Filename_12.txt or Filename_xx.txt ....... will be present in the FileDirectory. Hence i need only one anchor. – Satish Kumar Singh May 11 '22 at 19:50

0 Answers0