diff options
| author | Luke <luke.pulverenti@gmail.com> | 2017-09-01 15:26:02 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-09-01 15:26:02 -0400 |
| commit | 03b93e02b986af5610fa2cd2b848bdf32f9d20d7 (patch) | |
| tree | e99f1c3e83354de8edc8b739c84a7e82731df081 /MediaBrowser.Api/Library/LibraryService.cs | |
| parent | 00cb873164fb1619a2291e79bb53f3edcedcd731 (diff) | |
| parent | ac904c8ed0f79f63b61bdd0460a9f5a3b9ced65d (diff) | |
Merge pull request #2857 from MediaBrowser/dev
Dev
Diffstat (limited to 'MediaBrowser.Api/Library/LibraryService.cs')
| -rw-r--r-- | MediaBrowser.Api/Library/LibraryService.cs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/MediaBrowser.Api/Library/LibraryService.cs b/MediaBrowser.Api/Library/LibraryService.cs index 44cc60b50..6152ea20b 100644 --- a/MediaBrowser.Api/Library/LibraryService.cs +++ b/MediaBrowser.Api/Library/LibraryService.cs @@ -518,9 +518,18 @@ namespace MediaBrowser.Api.Library LogDownload(item, user, auth); } + var path = item.Path; + + // Quotes are valid in linux. They'll possibly cause issues here + var filename = (Path.GetFileName(path) ?? string.Empty).Replace("\"", string.Empty); + if (!string.IsNullOrWhiteSpace(filename)) + { + headers["Content-Disposition"] = "attachment; filename=\"" + filename + "\""; + } + return ResultFactory.GetStaticFileResult(Request, new StaticFileResultOptions { - Path = item.Path, + Path = path, ResponseHeaders = headers }); } |
