Could not find a part of the path

Discussion in 'ASP.NET 2.0' started by hungle, Jul 24, 2009.

  1. This is my code: I had that work before, but suddenly it not work any more.


    If Not (Myfile.PostedFile Is Nothing) Then
    Dim intFileNameLength As Integer
    Dim strFileNamePath As String
    Dim strFileNameOnly As String
    Dim uploadpath As String = Server.MapPath("~\images\")
    strFileNamePath = Myfile.PostedFile.FileName
    intFileNameLength = InStr(1, StrReverse(strFileNamePath), "\")
    strFileNameOnly = Mid(strFileNamePath, (Len(strFileNamePath) - intFileNameLength) + 2)
    Myfile.PostedFile.SaveAs(uploadpath & strFileNameOnly)

    End if
     
  2. What is the error message you are getting?

    Are you on iis 6 or 7?

    What changed from when it used to work to now?
     

Share This Page