Fixes to HQ download
This commit is contained in:
@@ -11,10 +11,10 @@ namespace Swarmops.Database
|
||||
public partial class SwarmDb
|
||||
{
|
||||
private string expenseClaimFieldSequence =
|
||||
" ExpenseClaimId,ClaimingPersonId,CreatedDateTime,Open,Attested," +
|
||||
" Validated,Claimed,OrganizationId,GeographyId,BudgetId," +
|
||||
" ExpenseDate,Description,PreApprovedAmount,AmountCents,Repaid,KeepSeparate, " +
|
||||
" VatCents, OrganizationSequenceId " +
|
||||
" ExpenseClaimId,ClaimingPersonId,CreatedDateTime,Open,Attested," + // 0-4
|
||||
" Validated,Claimed,OrganizationId,GeographyId,BudgetId," + // 5-9
|
||||
" ExpenseDate,Description,PreApprovedAmount,AmountCents,Repaid," + // 10-14
|
||||
" KeepSeparate,VatCents,OrganizationSequenceId " + // 15-17
|
||||
" FROM ExpenseClaims";
|
||||
|
||||
public BasicExpenseClaim GetExpenseClaim (int expenseClaimId)
|
||||
|
||||
@@ -30,6 +30,7 @@ namespace Swarmops.Logic.Support.BackendServices
|
||||
|
||||
private static void LongRun(object orderObject)
|
||||
{
|
||||
Console.WriteLine(" * LongRun running");
|
||||
RasterizeDocumentHiresOrder order = (RasterizeDocumentHiresOrder) orderObject;
|
||||
Document document = Document.FromIdentity(order.DocumentId);
|
||||
try
|
||||
@@ -38,7 +39,8 @@ namespace Swarmops.Logic.Support.BackendServices
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
order.ThrewException(exception);
|
||||
Console.WriteLine(" * Exception: " + exception.ToString());
|
||||
order.ThrewException(exception);
|
||||
}
|
||||
order.Close();
|
||||
order.HasTerminated = true;
|
||||
|
||||
@@ -174,13 +174,14 @@ namespace Swarmops.Pages.v5.Support
|
||||
|
||||
string contentType = string.Empty;
|
||||
|
||||
string fileNameLower = document.ClientFileName.ToLowerInvariant();
|
||||
string clientFileNameLower = document.ClientFileName.ToLowerInvariant().Trim();
|
||||
string serverFileNameLower = document.ServerFileName.ToLowerInvariant().Trim();
|
||||
|
||||
if (fileNameLower.EndsWith (".pdf"))
|
||||
if (clientFileNameLower.EndsWith (".pdf"))
|
||||
{
|
||||
contentType = MediaTypeNames.Application.Pdf;
|
||||
}
|
||||
else if (fileNameLower.EndsWith (".png"))
|
||||
else if (clientFileNameLower == (".png") || serverFileNameLower.EndsWith (".png")) // native PNG or converted PDF
|
||||
{
|
||||
contentType = "image/png"; // why isn't this in MediaTypeNames?
|
||||
if (Request.QueryString["hq"] == "1")
|
||||
@@ -192,7 +193,7 @@ namespace Swarmops.Pages.v5.Support
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (fileNameLower.EndsWith (".jpg"))
|
||||
else if (clientFileNameLower.EndsWith (".jpg") || clientFileNameLower.EndsWith(".jpeg"))
|
||||
{
|
||||
contentType = MediaTypeNames.Image.Jpeg;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user