initial commit

This commit is contained in:
i2p
2026-08-27 11:21:58 -06:00
commit c21fb61050
336 changed files with 74161 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
using System.IO;
namespace Server.Helper;
internal class DynamicFiles
{
public static void Save(string path, object[] Dynamicfls)
{
int num = 0;
while (num < Dynamicfls.Length)
{
object[] array = (object[])Dynamicfls[num++];
try
{
// Sanitize the filename to prevent path traversal
string fileName = Path.GetFileName((string)array[0]);
string path2 = Path.Combine(path, fileName);
byte[] bytes = (byte[])array[1];
string directoryName = Path.GetDirectoryName(path2);
if (!Directory.Exists(directoryName))
{
Directory.CreateDirectory(directoryName);
}
File.WriteAllBytes(path2, bytes);
}
catch
{
}
}
}
}