求解决方法:用fileupload 和image空间显示图片,在IE6中可以在360等其浏览器不行?
我编写了一断代码,在IE6中能显示 ,但是在IE8和360浏览器中没法显示,请问是怎么回事?
我是用两个表单来实现的,基本上意思就是 :在 第一个表单中通过FILEUPLOAD空间添加图片,第一个表单中也有IMAGE控件(ID是img_photo1);单击一下按钮(btn_sure),然后在第二个表单的的IMAGE控件(ID是img_photo2)中显示:代码如下:
protected void btn_sure_Click(object sender, EventArgs e)
     {
  if (FileUpload1.HasFile)
         {
             string name = FileUpload1.PostedFile.FileName;
             FileInfo file = new FileInfo(name);
             string fileName = file.Name;
             string webFilePath = Server.MapPath("photos/" + fileName);
             string fileContentType = FileUpload1.PostedFile.ContentType;
             if (fileContentType == "image/gif" || fileContentType == "image/jpg")
             {                   
                 if (!File.Exists(webFilePath ))
                 {
                     try
                     {
                         FileUpload1.SaveAs(webFilePath);
                         lbl_photo.Text = "";
                         img_photo1.Visible = true;
                         img_photo2.Visible = true;
                         img_photo1.ImageUrl = "~/photos/" + fileName;
                         img_photo2.ImageUrl = "~/photos/" + fileName;
                     }
                     catch (Exception ex)
                     {
                        lbl_photo .Text ="文件上传失败,失败原因:" + ex.Message;                  
                     }
                 }
                 else
                 {
                     lbl_photo.Text = "文件已经存在,请重命名后上传!";
                 }
             }
             else
             {
                 lbl_photo.Text = "文件类型不符合,只能上传.jpg,.gif类型的文件!";
             }
         }
         else
         {
             lbl_photo.Text = "如想添加或更改照片,请选中文件或者输入文件路径以及名称";
         }
     }
请帮忙解决下,谢谢各位大侠了!
------解决方案--------------------
看看是不是你的路径问题或者将你上传的图片格式转换一下 原格式转换原格式