【发布时间】:2012-01-30 22:40:00
【问题描述】:
我正在使用 uploadify 上传音频文件。它使用处理程序upload.ashx 将文件上传到服务器。我想在我的 aspx 页面中获取文件路径。所以我在处理程序中设置了一个会话值,以便我在 aspx 中获取文件路径,但我无法这样做。如何获取从处理程序到 .aspx 页面的文件路径值
public class Upload : IHttpHandler,IRequiresSessionState {
public void ProcessRequest (HttpContext context) {
string savepath = context.Server.MapPath(tempPath);
context.Session["VideoFile"] = savepath; } }
当我尝试获取文件路径时,在我的 aspx 页面中
DocLink = Session["VideoFile"].ToString();
会话值始终为空。如何在后面的代码中获取会话值
string path= HttpContext.Current.Request.Cookies["VideoFile"].ToString();
我试过这个,即使这是空的
【问题讨论】:
标签: c# asp.net session cookies