java - How to download a CSV file stored in server at location Temp/hello.csv -


i want download csv file @ server on location temp\hello.csv using java code

  1. i have data. populating data csv file, hello.csv
  2. this file saving/storing in server under \temp folder
  3. the csv file gets stored @ location temp\hello.csv folder in server.
  4. i want download file don't know how using java code

this should work (from https://docs.spring.io/spring/docs/current/spring-framework-reference/html/mvc.html#mvc-ann-async-output-stream):

@requestmapping("/download") public streamingresponsebody handle() {     return new streamingresponsebody() {         @override         public void writeto(outputstream outputstream) throws ioexception {             file file=new file("temp\hello.csv");             fileinputstream stream =new fileinputstream(file);             ioutils.copy(stream, outputstream);         }     }; } 

but there many other capabilities. (spring boot service download file , downloading file spring controllers , ...)


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -