개정판 0a89a17f
다운로드 파일명 수정
Change-Id: Ic6671952e536d9cffed7c136838174c03f6c6bb0
ConvertService/ServiceBase/Markus.Service.Extensions/Helper/GetDownloadFileName.cs | ||
---|---|---|
39 | 39 |
return FileName; |
40 | 40 |
} |
41 | 41 |
|
42 |
private static string GetDownloadFileName(string downloadUri)
|
|
42 |
public static string GetDownloadFileName(string downloadUri)
|
|
43 | 43 |
{ |
44 | 44 |
string fileName = ""; |
45 |
|
|
45 |
|
|
46 | 46 |
System.Net.WebClient wc = new System.Net.WebClient(); |
47 | 47 |
var data = wc.DownloadData(downloadUri); |
48 | 48 |
|
... | ... | |
51 | 51 |
var contentDisposition = wc.ResponseHeaders["Content-Disposition"]; |
52 | 52 |
fileName = GetFileNameInDisposition(new System.Net.Mime.ContentDisposition(contentDisposition)); |
53 | 53 |
} |
54 |
else |
|
55 |
{ |
|
56 |
var contenttype = wc.ResponseHeaders[System.Net.HttpResponseHeader.ContentType]; |
|
57 |
|
|
58 |
if (contenttype == "application/pdf") |
|
59 |
{ |
|
60 |
fileName = downloadUri.Remove(0, downloadUri.LastIndexOf("/") + 1); |
|
61 |
} |
|
62 |
} |
|
54 | 63 |
|
55 | 64 |
return fileName; |
56 | 65 |
} |
내보내기 Unified diff