I have a java class named as "HttpDownload.java" which has the method to download a file from URL provided and store it in a local directory. Please somebody tell me how to call that java class in Javascript where I have a function for a click event. Whenever I click download button the javascript function should call that java class.
Asked
Active
Viewed 37 times
0
-
Use [Tomcat](http://tomcat.apache.org/) or something and make a web request in your JavaScript. – Michael Feb 21 '18 at 08:35
-
Do you want to download something on the server or client? If on the server, @Michael mentions one option, but of course it depends greatly on what is currently running on your server. If on the client, then Java is likely not a good idea, use JavaScript's native downloading functions instead. – phihag Feb 21 '18 at 08:35