Smallfix IX

This commit is contained in:
Rick Falkvinge
2018-03-05 16:27:30 +01:00
parent 8a1efe856c
commit fdc44b4bd9
@@ -21,13 +21,6 @@ namespace Swarmops.Pages.v5.Support
string documentDownloadName = Request.QueryString["DocName"];
documentDownloadName = documentDownloadName.Replace("\"", "'");
if (documentDownloadName.EndsWith(" 2_1"))
{
// Mystery bug
documentDownloadName = documentDownloadName.Substring(0, documentDownloadName.Length - 4);
}
Document document = Document.FromIdentity (documentId);
//Orgid is needed to safely verify permission
@@ -214,6 +207,15 @@ namespace Swarmops.Pages.v5.Support
}
}
if (documentDownloadName.EndsWith(" 2_1") || documentDownloadName.EndsWith(" 2/1"))
{
// Mystery bug
documentDownloadName = documentDownloadName.Substring(0, documentDownloadName.Length - 4);
}
string legacyMarker = string.Empty;
if (!File.Exists (Document.StorageRoot + serverFileName))
@@ -237,7 +239,7 @@ namespace Swarmops.Pages.v5.Support
}
}
Response.ContentType = contentType;
Response.AppendHeader("Content-Type", contentType);
Response.AppendHeader("Content-Disposition", "attachment; filename=\"" + documentDownloadName + "\"");
Response.TransmitFile (Document.StorageRoot + legacyMarker + serverFileName);
}