Vulnerability in EPiServer.Forms
string filePath = "/Global/MyFolder/Image1.jpg";
How can I modify or delete/create that file programatically?
I tried using Virtual path but it's open functionality returns a read -only stream.
VirtualFile virtualFile = HostingEnvironment.VirtualPathProvider.GetFile(virtualPath);
There's a UnifiedDirectory.CreateFile(filename) but there's no UnifiedDirectory.DeleteFile(filename).
I'm still finding out how to delete/create or replace the file in File manager.
UnifiedFile file = VirtualPathHandler.Instance.GetFile(filePath, true) as UnifiedFile;stream = file.Open(FileMode.OpenOrCreate, FileAccess.ReadWrite);