Empty space in filename issue while downloading file
问题 Following java code is being used to download a requested log file throgh a web application: protected HttpServletResponse response; .... response.setContentType("application/octet-stream"); String filename = OrgName + ".log"; response.setHeader("Content-Disposition", "attachment; filename= " + filename); OutputStream os = response.getOutputStream(); os.write(getFile()); os.close(); Problem comes when OrgName contains a space like "Xyz Pvt Ltd", in this case file will be download with name