Added support for PDFs and Images
This commit is contained in:
31
PWAPPv2/Source/DataObjects/PWPdf.cs
Normal file
31
PWAPPv2/Source/DataObjects/PWPdf.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PWAPPv2.Source.DataObjects
|
||||
{
|
||||
public class PWPdf
|
||||
{
|
||||
public string path;
|
||||
|
||||
|
||||
public PWPdf(string path)
|
||||
{
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
public string GetBase64String()
|
||||
{
|
||||
byte[] bytes = File.ReadAllBytes(path);
|
||||
return Convert.ToBase64String(bytes);
|
||||
}
|
||||
|
||||
public string ShortFileName()
|
||||
{
|
||||
return path.Substring(path.LastIndexOf("\\") + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user