Good afternoon. I need to make sure that when a button is clicked, a new Excel file is created. I already have this function and everything works, but .. The path and file name are written IN the function itself, and I need to make sure that the path and file name are chosen by the user. How to do it?
<input type="file">
only allows you to select from existing files. And I need to get exactly the path and name for the NEW file.
My function
@SneakyThrows
@GetMapping("/Exel")
@ResponseBody
public void updateNotFullPay(){
Integer year = 2022;
List<DescriptionMotion> description = descriptionMotionService.findMoveByAllBranchAndYear(year);
String file = "C:\\Users\\Elina-AA-int\\exe.xlsx";
XSSFWorkbook book = new XSSFWorkbook();
XSSFSheet sheet = book.createSheet("ОК (ООТиЗ)");
.......
//code//
}
My input and link with which I don't know what to do
<input type="file">
<a type="button" class="btn btn-primary btn-sm" th:href="@{/report/Exel}">Создать Exel-файл за текущий год</a>