Friend Sub upfile(ByVal filepath_dy As String, ByVal filesize As Integer)
        Try
            Dim filename As String = lofile.PostedFile.FileName
            Dim filenames As String = System.IO.Path.GetFileName(filename)
            Dim filepath As String = filepath_dy & filenames
            lofile.PostedFile.SaveAs(filepath)
end sub
自己写的一个代码,在本地可以,换了机器IE就出现:缺少"/",谁知道原因?或是代码,谢谢了

解决方案 »

  1.   

    落这么快
    没有用asp.net做上传的人吗?
      

  2.   

    filepath_dy是什么?直接用server.mappath加文件名应该就可以了吧
    c#的
    if (FileUpload1.HasFile)
    {
    string sPath = Server.MapPath(@"Images\") + FileUpload1.FileName;
    FileUpload1.SaveAs(sPath);
    }
    else
    {
    Response.Write("<script>window.alert('Please Select a file!');</script>");
    }
      

  3.   

    if (fileUpload.PostedFile.FileName.Length>0 && fileUpload.PostedFile.ContentLength>0)
    {
    try
    {
    fileName=System.IO.Path.GetFileName(fileUpload.PostedFile.FileName);
    fileContentType=fileUpload.PostedFile.ContentType;
    fileExtention=System.IO.Path.GetExtension(fileName);
    if(fileExtention.ToLower() ==".mp3" || fileExtention.ToLower() ==".wma")
    {
    strFilePath="modules/music/music/"+fileName.Substring(fileName.LastIndexOf("\\")+1);
    strFileFullPath = Request.PhysicalApplicationPath+strFilePath;
    fileUpload.PostedFile.SaveAs(strFileFullPath);
    }
    else
    {
    this.lblState.Text="请上传音乐文件";
    successful = false;
    }
    }
    catch(Exception ee)
    {
    ee.ToString();
    successful = false;
    } this.lblState.Text="上传成功";
    }
      

  4.   

    filepath_dy是我定义的一个stirng参数,楼上两位的代码和我写的一样啊,出错和IIS有没有关系?