Dim strFileFolder As String = Server.MapPath(".") & @"\files\" & strFileName
                                                    ^呵呵 只是猜想

解决方案 »

  1.   

    应该不是,每次都是在fileUp.PostedFile中出错
      

  2.   

    Dim strFileName As String = fileUp.Value
    这一句有问题
    因为你的fileUP.Value==null
    所以报错,一定是
      

  3.   

    to vzxq :不是那样的,注释掉 fileUp.PostedFile.SaveAs(strFileFolder)这句代码
    程序不会出错,而且路径也是正确的
    to newman: fileup 是从工具箱中直接拖放到窗体界面上的,
      

  4.   

    或许是这样的
    Dim strFileName As String = fileUp.PostFile.FileName;----------------------------------------------------------------------
    欢迎试用ASP.NET大文件上传组件(AspnetUpload 1.1 Release & 无刷新进度条)
    http://www.cnblogs.com/bestcomy/archive/2004/06/09/14267.aspx
    http://bestcomy.europe.webmatrixhosting.net
    ----------------------------------------------------------------------
      

  5.   

    strFileName = Path.GetFileName(strFileName)
    这个不对 Path哪来的啊
      

  6.   

    <script runat =server>
          void UploadBtn_Click(Object sender, EventArgs e) {
             String filename;
             String filename1;
             String[] filename2;
             int q;
             filename=UploadFile.PostedFile.FileName ;
             filename2=filename.Split(new Char[] {'\\'});
             q=filename2.GetUpperBound(0);
             filename1=filename2[q];
             dis.Text="上传文件名:"+filename1+"<br/>";
             UploadFile.PostedFile.SaveAs(Server.MapPath(filename1));
             ImageEditor.Visible = true;
             dis.Text+="文件大小:"+UploadFile.PostedFile.ContentLength+"字节数";
             Image1.Src=filename1;      
          } 
          void UpdateBtn_Click(Object sender, EventArgs e) {
            String filename1;
       filename1=Image1.Src;
       System.Drawing.Image image = System.Drawing.Image.FromFile(Server.MapPath(filename1));
       System.Drawing.Image newimage = new Bitmap(image.Width, image.Height, PixelFormat.Format32bppRgb);
       Graphics g = Graphics.FromImage(newimage);
       g.DrawImage(image,0,0,image.Width,image.Height);
       Font f = new Font(FontType.SelectedItem.Text, Int32.Parse(FontSize.SelectedItem.Text));
       Brush b = new SolidBrush(Color.Red);
       g.DrawString(Caption.Text, f, b, 10, 140);
       g.Dispose();
       //System.Drawing.Image thumbImage = newimage.GetThumbnailImage(Convert.ToInt32(Width.Text),Convert.ToInt32(Height.Text),null,0);
       image.Dispose();
      // thumbImage.Save(Server.MapPath(filename1), ImageFormat.Jpeg);
       Image1.Src=filename1;       
       Caption.Text="";     
          }   </script>
      

  7.   

    应该是fileup的PostedFile没有取到!是不是你的文件太大了!默认好像只能传4M的!
      

  8.   

    看看接受上传的文件权限(everyone)
      

  9.   

    这些都没有问题,只是写在<script>里面就能够运行
    写在.vb后就不行了
    path是直接引用了一个命名空间所自带的方法
    权限设置也是没有问题的,
    有谁试过这段代码吗?