I cannot get a response from HttpContext.Current.User.Identity.Name in my handler file. Is the data not being passed to it?
<%@ WebHandler Language="C#" Class="uploadHandler" %>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public class uploadHandler : IHttpHandler {
public void ProcessRequest(HttpContext context)
{
HttpPostedFile file = context.Request.Files["fileData"];
string targetLocation = "D:\\inetpub\\wwwroot\\upload.website.com\\www\\uploads\\" + HttpContext.Current.User.Identity.Name + "\\" + file.FileName;
file.SaveAs(targetLocation);
context.Response.ContentType = "text/plain";
context.Response.Write("Hello World");
context.Response.Write(HttpContext.Current.User.Identity.Name);
}
public bool IsReusable {
get {
return false;
}
}
}