2023-07-27 19:15:49 -04:00

35 lines
1.0 KiB
C#

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() + "'}\"";
}
}
}