This question is locked. New answers and comments are not allowed.
Hi, I'm trying to replace the content of a uploading file in the FileUploadStarting event.
This is my code. But it doesn't work. It seems the original file is still written.
The idea is to write a XML file (as string) to the server.
Do you have an example how to use NewFileSream? Or what I'm doing wrong?
Thanks
Eric
This is my code. But it doesn't work. It seems the original file is still written.
e.NewFileStream =
new
MemoryStream();
using
(var writer =
new
StreamWriter(e.NewFileStream, Encoding.UTF8))
{
writer.Write(_model.GetXml());
writer.Flush();
writer.Close();
}
The idea is to write a XML file (as string) to the server.
Do you have an example how to use NewFileSream? Or what I'm doing wrong?
Thanks
Eric