I am downloading a file from a controller. It does not work. It is because of the "," in the filename. If I remove the "," from the name it will work. Is there any work around for this. Should I do String.replace("," ""). There must be a better way?
response.setHeader("Content-Disposition", "inline; filename=" + "abbbbababbaababba.4.1.2013,aakdfhfdf.xlsx");
Complete method
@RequestMapping(value = "/newsimage/{newsImageId} ", method = RequestMethod.GET)
public void getImage(HttpServletRequest request, HttpServletResponse response, @PathVariable long newsImageId) {
    NewsImage newsImage = newsImageService.findById(newsImageId);
    String fileName = newsImage.getFileName();
        response.setHeader("Content-Disposition", "inline; filename=" + "abbbbababbaababba.4.1.2013,aakdfhfdf.xlsx");
    response.setContentType(newsImage.getContentType());
    // response.setHeader("Content-Disposition", "attachment;filename=" + newsImage.getFileName());
    OutputStream out;
    try {
        out = response.getOutputStream();
        out.write(newsImage.getData());
        out.flush();
    } catch (IOException e) {
        logger.error(e.getMessage());
    }
}
 
     
     
    