阅读背景:

网站上自己写的上传方法

来源:互联网 
 


protected void btnUploadFile_ServerClick(object sender, EventArgs e)
        {
            //文件上传 方法,
            string filepath = this.txtFilePath.Value;
            filepath = filepath.Replace("/","\");

             string serverPath = Server.MapPath("~/SaveImage"); //服务器文件夹 所在的物理目录

             string savePath = serverPath +"\"+ filepath.Substring(filepath.LastIndexOf('\') + 1);//
           
            MemoryStream ms = ReadFileStream(filepath);
            bool result = ThunderByHttp(ms, savePath);
            string script = "";
            if (result)
            {
                script = "alert('上传成功')";
            }
            else
            {
                script = "alert('上传失败')";
            }

            ScriptManager.RegisterStartupScript(this, this.GetType(), "", script, true);

        }
protected void btnUploadFile_Serv



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: