Visualizzazione dei risultati da 1 a 8 su 8

Discussione: Upload file (errore)

  1. #1
    Utente di HTML.it L'avatar di Kahm
    Registrato dal
    Dec 2004
    residenza
    Rome
    Messaggi
    3,582

    Upload file (errore)

    salvea tutti
    non appena cerco di uplodare un file nel server da asp.net mi da questo errore

    codice:
    Server Error in '/' Application.
    Access to the path "D:\home\w3km02s36\prenotazioni\logo.jpg" is denied.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
    
    Exception Details: System.UnauthorizedAccessException: Access to the path "D:\home\w3km02s36\prenotazioni\logo.jpg" is denied.
    
    ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.
    
    To grant ASP.NET write access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.
    
    Source Error:
    
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
    
    Stack Trace:
    
    [UnauthorizedAccessException: Access to the path "D:\home\w3km02s36\prenotazioni\logo.jpg" is denied.]
       System.IO.__Error.WinIOError(Int32 errorCode, String str) +393
       System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath, Boolean bFromProxy) +888
       System.IO.FileStream..ctor(String path, FileMode mode) +52
       System.Web.HttpPostedFile.SaveAs(String filename) +48
       hotelmetropolitan.Impostazioni.CMD_ImgMail_Click(Object sender, EventArgs e)
       System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
       System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
       System.Web.UI.Page.ProcessRequestMain() +1292
    
    
    Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET Version:1.1.4322.2300
    il codice he uso è questo:



    codice:
        Dim PathDB As String
            Dim NOmeFIle As String = Right(Me.File1.Value, Len(Me.File1.Value) - InStrRev(Me.File1.Value, "\"))
    
            Try
                PathDB = Server.MapPath("../" & NOmeFIle)
                File1.PostedFile.SaveAs(PathDB)
            Catch ex As Exception
                Me.LBL_Messaggio.Text = ex.Message
                Exit Sub
            End Try
    da cosa puo0 dipendere?
    grazie
    NN vi diro mai chi sono in realta,
    tutti i miei 3D sono orfani, non insistete per farmi rispondere ai 3D aperti da me

  2. #2
    Permessi di scrittura su quel folder

    Aggiungi l'ASP .Net user come utente in scrittura

  3. #3
    Utente di HTML.it L'avatar di Kahm
    Registrato dal
    Dec 2004
    residenza
    Rome
    Messaggi
    3,582
    Originariamente inviato da DarioN1
    Permessi di scrittura su quel folder

    Aggiungi l'ASP .Net user come utente in scrittura
    eh...asp ecco il web.config
    codice:
        <authorization>
            <allow users="*" /> 
    
                <!--  <allow     users="[elenco di utenti separati da virgole]"
                                 roles="[elenco di ruoli separati da virgole]"/>
                      <deny      users="[elenco di utenti separati da virgole]"
                                 roles="[elenco di ruoli separati da virgole]"/>
                -->
        </authorization>
    qui dentro intendi dire vero?
    che devo aggiungere il mio utente?
    giusto?
    NN vi diro mai chi sono in realta,
    tutti i miei 3D sono orfani, non insistete per farmi rispondere ai 3D aperti da me

  4. #4
    No no , in questo folder :

    D:\home\w3km02s36\prenotazioni

    Controlla che l'ASP .Net user ha i permessi in scrittura

  5. #5
    Access to the path "D:\home\w3km02s36\prenotazioni\logo.jpg" is denied.

    ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

    To grant ASP.NET write access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.

  6. #6
    Utente di HTML.it L'avatar di Kahm
    Registrato dal
    Dec 2004
    residenza
    Rome
    Messaggi
    3,582
    sai, il problema è che ci sto smanettando da ftp
    quindi non posso fare tasto destro->proprieta->utenti....

    secondo te è il caso di chiamare il servizio hosting?
    grazie
    NN vi diro mai chi sono in realta,
    tutti i miei 3D sono orfani, non insistete per farmi rispondere ai 3D aperti da me

  7. #7
    Eh si , devi settare i permessi in scrittura di quel folder

  8. #8
    Ho letto il tuo messaggio privato. Hai lo stesso errore ora ???

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.