Upload file to server

Discussion in 'ASP.NET / ASP.NET Core' started by Bruce, Aug 16, 2005.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Bruce

    Bruce DiscountASP.NET Staff

    may be you have FrontPage extension installed on your site. FPSE sometimes can mess up permission setting.

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  2. Thanks, you were right. I ended up removing FP and re-enabling this sorted it out,
     
  3. Can anybody see why the below code might cause a server error (500), It fails before or during the line 'File1.PostedFile.SaveAs(SaveLocation)'. It runs locally on my development machine without a problem, however does not run on the discountasp.net server.


    Any help would be appreciated


    Private Function SaveFile(ByVal strPath As String) As String


    If Not File1.PostedFile Is Nothing And File1.PostedFile.ContentLength > 0 Then


    Dim fn As String = System.IO.Path.GetFileName(File1.PostedFile.FileName)


    Dim SaveLocation As String = Server.MapPath(strPath) & "\" & fn


    File1.PostedFile.SaveAs(SaveLocation)


    Return Replace(strPath, "../", "") & "/" & ResizeImage(fn, Server.MapPath(strPath))


    Else


    Return ""


    End If


    End Function
     
  4. I have found the error, its an access denied error to the folder. I have granted anonymous read/write access to the folder in question, but still get the error. Anyone got any ideas?
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page