Esempio n. 1
0
        public static void FileUploadComplete(object sender, DevExpress.Web.FileUploadCompleteEventArgs e)
        {
            MVCxUploadControl upControl = sender as MVCxUploadControl;
            int ticketId = Convert.ToInt32(upControl.Request.Params["ticketID"]);

            if (e.UploadedFile.IsValid)
            {
                tcpjw3.oa.Models.tcpjwEntities db = new tcpjw3.oa.Models.tcpjwEntities();
                TicketDiscount ticketDiscount     = db.TicketDiscount.Where(t => t.TicketID == ticketId).FirstOrDefault();

                string filePath = ticketDiscount.TicketBackImg;
                Uri    uri      = new Uri(filePath);

                //var fileName = Path.Combine(upControl.Request.MapPath("~/"), uri.AbsolutePath);
                //var fileName = upControl.Request.MapPath("~/")+uri.AbsolutePath;
                var fileName = "E:\\TCPJW_Developer\\Code\\TCPJW.OA" + uri.AbsolutePath;//路径先这样写
                e.UploadedFile.SaveAs(fileName);
                //e.UploadedFile.SaveAs(Server.MapPath("~/") + uri.AbsolutePath);
                e.CallbackData = ticketDiscount.TicketBackImg;
            }
        }