Files
PWAPP/PWAPPv2/Source/DataObjects/Attachment.cs
Matthew Burke 09d86b86c2 Images working
2023-07-27 18:59:51 -04:00

41 lines
1.1 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PWAPPv2.Source.DataObjects
{
class Attachment
{
APICredentials Credentials;
PWImage image;
string Token;
public Attachment(APICredentials credentials, PWImage pwImage, string token)
{
Credentials = credentials;
image = pwImage;
Token = token;
}
public string ToJsonString()
{
return "\"{" + Credentials.BuildJsonBodyContents() +
",'UserNum':'API'," +
"'AttToken':'" + Token.Replace("\"", "") + "'," +
"'FileName':'" + image.ShortFileName() + "'," +
"'ContentType':'_1'," +
"'ThumbExists':'1'," +
"'ZoomExists':'1'," +
"'FileDate':''," +
"'Base64FileContents':'" + image.GetBase64String() + "',\n" +
"'Base64ThumbContents':'" + image.GetBase64ThumbString() + "',\n" +
"'Base64ZoomContents':'" + image.GetBase64ZoomString() + "'}\"";
}
}
}