Modified how attachments are pushed to the API.

Added support for BMP and GIF image types.
This commit is contained in:
goomatt33
2024-03-25 13:21:14 -04:00
parent f31302438d
commit 205b3d8014
10 changed files with 202 additions and 17 deletions
@@ -1,4 +1,5 @@
using PWAPPv2.Source.DataObjects;
using Microsoft.Identity.Client;
using PWAPPv2.Source.DataObjects;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -49,5 +50,29 @@ namespace PWAPPv2.Source.Attachments
return attachment;
}
public static PWBaseAttachment BuildBaseAttachment(string token, PWImage image)
{
PWBaseAttachment attachment = new PWBaseAttachment();
attachment.AttToken = token.Replace("\"", "");
attachment.ThumbExists = true;
attachment.ZoomExists = true;
attachment.FileDate = "";
attachment.FileName = image.ShortFileName();
attachment.FileType = image.FileType;
return attachment;
}
public static PWBaseAttachment BuildBaseAttachment(string token, PWPdf pdf)
{
PWBaseAttachment attachment = new PWBaseAttachment();
attachment.AttToken = token.Replace("\"", "");
attachment.ThumbExists = false;
attachment.ZoomExists = true;
attachment.FileDate = "";
attachment.FileName = pdf.ShortFileName();
attachment.FileType = "application/pdf";
return attachment;
}
}
}