首页 新闻 会员 周边

uploadify插件上传图片怎么保存到数据库?用ASP.NET实现。

0
悬赏园豆:20 [已关闭问题] 关闭于 2012-07-08 15:12

按照我的想法,如果能在后台取得uploadify上传图片后的路徑,保存到数据库就不成问题了。当然还是希望各位能够提供比较全面的实现方法,最好能贴上实现的代码,感激不尽了!!1

justinwujian的主页 justinwujian | 初学一级 | 园豆:114
提问于:2012-07-04 23:27
< >
分享
所有回答(2)
0
View Code
    public void ProcessRequest(HttpContext context)
        {
            DAL.ProducDal.IsCanel = false;
            context.Response.ContentType = "text/plain";
            context.Response.Charset = "utf-8";

            HttpPostedFile file = context.Request.Files["Filedata"];
            string uploadPath =
                HttpContext.Current.Server.MapPath("UploadFile") + "\\";
           
            if (file != null)
            {
                file.SaveAs(uploadPath + "Product.XLS");
                //下面这句代码缺少的话,上传成功后上传队列的显示不会自动消失
                string message = UpdataFileToData(context);
                DAL.ProducDal.IsCanel = false;
                context.Response.Write(message);

            }
            else
            {
                DAL.ProducDal.IsCanel = false;
               // context.Response.Write("0");
            } 
        }

你本来 就可以得到上传的文件的。

無限遐想 | 园豆:3740 (老鸟四级) | 2012-07-05 09:38
0

上传后的文件存放的地址不都是你自己在webconfig配好的吗?路径就可以组合获取。

jerry-Tom | 园豆:4077 (老鸟四级) | 2012-07-05 09:55
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册