diff --git a/src/org/ohmage/request/audio/AudioReadRequest.java b/src/org/ohmage/request/audio/AudioReadRequest.java index f7c12d12..be663fcb 100644 --- a/src/org/ohmage/request/audio/AudioReadRequest.java +++ b/src/org/ohmage/request/audio/AudioReadRequest.java @@ -148,7 +148,7 @@ public void respond( httpResponse.setHeader( "Content-Disposition", - "attachment; filename=" + audio.getFileName()); + "attachment; filename=\"" + audio.getFileName() + "\""); httpResponse.setHeader( "Content-Length", new Long(audio.getFileSize()).toString()); @@ -225,4 +225,4 @@ public void respond( } } } -} \ No newline at end of file +} diff --git a/src/org/ohmage/request/campaign/CampaignReadRequest.java b/src/org/ohmage/request/campaign/CampaignReadRequest.java index af47d076..cec61a40 100644 --- a/src/org/ohmage/request/campaign/CampaignReadRequest.java +++ b/src/org/ohmage/request/campaign/CampaignReadRequest.java @@ -571,7 +571,7 @@ else if(OutputFormat.XML.equals(outputFormat)) { httpResponse .setHeader( "Content-Disposition", - "attachment; filename=" + campaign.getName() + ".xml"); + "attachment; filename=\"" + campaign.getName() + ".xml\""); try { responseText = campaign.getXml(); diff --git a/src/org/ohmage/request/clazz/ClassRosterReadRequest.java b/src/org/ohmage/request/clazz/ClassRosterReadRequest.java index a44356c7..beebfe61 100644 --- a/src/org/ohmage/request/clazz/ClassRosterReadRequest.java +++ b/src/org/ohmage/request/clazz/ClassRosterReadRequest.java @@ -171,7 +171,7 @@ public void respond(HttpServletRequest httpRequest, HttpServletResponse httpResp // Set the type and force the browser to download it as the // last step before beginning to stream the response. httpResponse.setContentType("ohmage/roster"); - httpResponse.setHeader("Content-Disposition", "attachment; filename=roster.csv"); + httpResponse.setHeader("Content-Disposition", "attachment; filename=\"roster.csv\""); // If available, set the token. if(getUser() != null) { diff --git a/src/org/ohmage/request/image/ImageBatchZipReadRequest.java b/src/org/ohmage/request/image/ImageBatchZipReadRequest.java index e8c29d0f..fba39b2e 100644 --- a/src/org/ohmage/request/image/ImageBatchZipReadRequest.java +++ b/src/org/ohmage/request/image/ImageBatchZipReadRequest.java @@ -191,7 +191,7 @@ public void respond( // the header to indicate that this will be an attachment. httpResponse.setHeader( "Content-Disposition", - "attachment; filename=images.zip"); + "attachment; filename=\"images.zip\""); // Create the zip stream to the outside world. ZipOutputStream zipStream = null; @@ -341,4 +341,4 @@ else if(response instanceof RepeatableSetResponse) { return result; } -} \ No newline at end of file +} diff --git a/src/org/ohmage/request/image/ImageZipReadRequest.java b/src/org/ohmage/request/image/ImageZipReadRequest.java index 415735f1..bef95be9 100644 --- a/src/org/ohmage/request/image/ImageZipReadRequest.java +++ b/src/org/ohmage/request/image/ImageZipReadRequest.java @@ -106,7 +106,7 @@ public void respond( // the header to indicate that this will be an attachment. httpResponse.setHeader( "Content-Disposition", - "attachment; filename=images.zip"); + "attachment; filename=\"images.zip\""); // Create the zip stream to the outside world. ZipOutputStream zipStream = null; @@ -256,4 +256,4 @@ else if(response instanceof RepeatableSetResponse) { return result; } -} \ No newline at end of file +} diff --git a/src/org/ohmage/request/media/MediaReadRequest.java b/src/org/ohmage/request/media/MediaReadRequest.java index 9d902e6d..5a0fb54e 100644 --- a/src/org/ohmage/request/media/MediaReadRequest.java +++ b/src/org/ohmage/request/media/MediaReadRequest.java @@ -180,7 +180,7 @@ public void respond( // only set content-disposition if media is not video/image/audio if (contentType.startsWith("application") || contentType.startsWith("text")) httpResponse.setHeader("Content-Disposition", - "attachment; filename=" + media.getFileName()); + "attachment; filename=\"" + media.getFileName() + "\""); httpResponse.setHeader("Content-Length", new Long(media.getFileSize()).toString()); @@ -265,4 +265,4 @@ public void respond( } } } -} \ No newline at end of file +} diff --git a/src/org/ohmage/request/mobility/MobilityReadCsvRequest.java b/src/org/ohmage/request/mobility/MobilityReadCsvRequest.java index 79528b24..39d132b8 100644 --- a/src/org/ohmage/request/mobility/MobilityReadCsvRequest.java +++ b/src/org/ohmage/request/mobility/MobilityReadCsvRequest.java @@ -271,7 +271,7 @@ public void respond( // Set the type and force the browser to download it as the // last step before beginning to stream the response. httpResponse.setContentType("text/csv"); - httpResponse.setHeader("Content-Disposition", "attachment; filename=Mobility.csv"); + httpResponse.setHeader("Content-Disposition", "attachment; filename=\"Mobility.csv\""); // If available, set the token. if(getUser() != null) { @@ -368,4 +368,4 @@ public void respond( HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } } -} \ No newline at end of file +} diff --git a/src/org/ohmage/request/survey/SurveyResponseReadRequest.java b/src/org/ohmage/request/survey/SurveyResponseReadRequest.java index 3b6aa5cf..df825685 100644 --- a/src/org/ohmage/request/survey/SurveyResponseReadRequest.java +++ b/src/org/ohmage/request/survey/SurveyResponseReadRequest.java @@ -1248,10 +1248,10 @@ else if(OutputFormat.CSV.equals(outputFormat)) { // Mark it as an attachment. httpResponse.setContentType("text/csv"); httpResponse.setHeader( - "Content-Disposition", - "attachment; filename=" + - getCampaign().getName() + - ".csv"); + "Content-Disposition", + "attachment; filename=\"" + + getCampaign().getName() + + ".csv\""); StringBuilder resultBuilder = new StringBuilder(); diff --git a/src/org/ohmage/request/video/VideoReadRequest.java b/src/org/ohmage/request/video/VideoReadRequest.java index 68c4a60e..32a450dc 100644 --- a/src/org/ohmage/request/video/VideoReadRequest.java +++ b/src/org/ohmage/request/video/VideoReadRequest.java @@ -136,7 +136,7 @@ public void respond( httpResponse.setHeader( "Content-Disposition", - "attachment; filename=" + video.getFileName()); + "attachment; filename=\"" + video.getFileName() + "\""); httpResponse.setHeader( "Content-Length", new Long(video.getFileSize()).toString()); @@ -213,4 +213,4 @@ public void respond( } } } -} \ No newline at end of file +}