You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.0 KiB
42 lines
1.0 KiB
using NLog.LayoutRenderers;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Helper
|
|
{
|
|
public class clsFileHelper
|
|
{
|
|
public string save_temp_file(string data, string dokumentid, string temppath, string extension)
|
|
{
|
|
|
|
string filename = temppath+ DateTime.Now.ToString("yyyyMMddhhmmss") + "_" + dokumentid + "." + extension;
|
|
try
|
|
{
|
|
System.IO.File.WriteAllBytes(filename, Convert.FromBase64String(data));
|
|
return filename;
|
|
}
|
|
catch
|
|
{
|
|
return "";
|
|
}
|
|
}
|
|
|
|
public bool SaveBase64ToFile(string Base64String, string filename)
|
|
{
|
|
try
|
|
{
|
|
System.IO.File.WriteAllBytes(filename, Convert.FromBase64String(Base64String));
|
|
return true;
|
|
}
|
|
catch
|
|
{
|
|
return false;
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|