How to set filename containing spaces in Content-Disposition header April 23, 2023 by Tarik Use quotes: resp.addHeader("Content-Disposition", "inline; filename=\"" + fileName + "\"");