Answer the question
In order to leave comments, you need to log in
How to return HTML file as server response?
I can't share information on how to return an html file as a response from the server. Let's say the user clicks on the transition to a new page on the tag <a id = "newPage">newPage</a>
. I need to indicate the path to this file in response, but I don’t understand how to do this, I write a backend in java
Answer the question
In order to leave comments, you need to log in
If I understand correctly, the task is to prompt the client (browser) to download the file. I'm right? For this case, the simplest solution is to add the download
keyword to the a tag :
But the best option is to return a Content-Disposition header in the response from the server :Content-Disposition: attachment; filename=123.html
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question