Hi davidhoyt,
I saw the code, great work!
The code works fine, but I have in my code that every Session variable is null.
context.Session is always null, I really don't understand why?
While context.Request.QueryString["myVariable"] works fine.
Have you got an idea?
private class FileProcessor : AbstractFileUploadProcessor
{
protected override void processUpload(
HttpContext context,
IPost post,
System.IO.Stream stream,
byte[] buffer,
int bufferSize,
System.Text.Encoding encoding)
{
//Saves files to the current project's directory. You should probably do something more intelligent here.
int read = 0;
byte[] _documentbyte = new byte[bufferSize];
using (FileStream fs = new FileStream(context.Server.MapPath("~/" + post.FileName), FileMode.Create))
{
while ((read = stream.Read(buffer, 0, bufferSize)) >= 0)
fs.Write(buffer, 0, read);
fs.Close();
}
// all fine up to here
if (context.Session["mySessionName"] == null) return;
context.Session["mySessionName"] throws a NullReferenceException !
}
}
Thanx a lot
Matteo