RadAsyncUpload Issue with Forms Authentication using roles

7 posts, 0 answers
  1. Alejandro
    Alejandro avatar
    4 posts
    Member since:
    Nov 2012

    Posted 17 Apr 2013 Link to this post

    Hi,
    I am using RadAsyncUpload (Q2 2012 SP1) with Forms Authentication using roles, it works well on my localhost, but when i deploy the site to my production server when i try to upload a file it simply doesn't work on submitting, i was debugging using  Firebug with Chrome and Firefox and this is what i get on the error console:
    This is an example of how i have one of my configuration files for one role:

    <?xmlversion="1.0"?>

    <configuration>

    <system.web>

    <authorization>

    <!—-->

    <allowroles="Alumno"/>

    <denyusers="*"/>

    </authorization>

    </system.web>

    <locationpath="Telerik.Web.UI.WebResource.axd">

    <system.web>

    <authorization>

    <allowusers="*" />

    </authorization>

    </system.web>

    </location>

    </configuration>

    The control declaration in my aspx file looks like this:

    <telerik:RadAsyncUploadrunat="server"ID="T_uploadArchivo"MaxFileInputsCount="1"AllowedFileExtensions="doc,docx"

    onfileuploaded="T_uploadArchivo_FileUploaded"TemporaryFolder="~/Inicio/Alumno/Temporal">

    <FileFilters>

    <telerik:FileFilterDescription="Documentos de Procesador de textos(*.doc y *.docx)"Extensions="doc,docx"/>

    </FileFilters>

    </telerik:RadAsyncUpload>

    The temporary folder is inside the same folder where authenticated user is, and i move the file manually to the Final Destination.

    I also have tried some other solutions posted on the forums but nothing seems to work, i hope someone could help me solve this, thanks.


  2. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 19 Apr 2013 Link to this post

    Hi Alejandro,

    Have you tried to enable anonymous authentication in IIS? It might be that you are running under the flash module, which is not capable of working in authenticated environment unless anonymous auth. is enabled and the web.config location tag is added.

    All the best,
    Genady Sergeev
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Alejandro
    Alejandro avatar
    4 posts
    Member since:
    Nov 2012

    Posted 19 Apr 2013 Link to this post

    Thanks Sergeeev, i have tried this solution before, i'll attach an image of how th authentication configuration looks in IIS in for my website, and i also have tried to disable the flash and silverlight module using the javascript code i've found on another forum thread to see how it works but still getting the same results.
    The web.config file from one of the roles i'm using looks like this:

    <?xml version="1.0"?>
    <configuration>
        <system.web>
          <authorization>
            <!-- Order and case are important below -->
            <allow roles="Administrador"/>
            <deny users="*"/>
          </authorization>
        </system.web>
        <location path="~/Telerik.Web.UI.WebResource.axd">
          <system.web>
            <authorization>
              <allow users="*" />
            </authorization>
          </system.web>
        </location>
    </configuration>

    Where you can see the location path is ok i guess, is there any other solution i can try to solve this issue?
  5. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 23 Apr 2013 Link to this post

    Hello Alejandro,

    Could you please clarify when the error occurs? When you select a file or when the page is submitted after a file is uploaded. If it is the second case try to comment your custom logic and test the application. That is how we are going to determine from where the issue origins.

    Kind regards,
    Peter Filipov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  6. Alejandro
    Alejandro avatar
    4 posts
    Member since:
    Nov 2012

    Posted 23 Apr 2013 Link to this post

    Thanks Peter, the error occurs when i submit the form, i have tried the control in a new test website witohout all the custom logic and also without forms authentication which is what i think causes the error but it wasn't like that, i first uploaded the page to my production server leaving  the control without assigning a target folder like you can see in the next Code Block:

    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
        <div>
            <telerik:RadAsyncUpload runat="server" ID="T_uploadArchivo" >
            </telerik:RadAsyncUpload>
        <asp:Button ID="Button1" runat="server" Text="Button" />
        </div>
        </form>


    And it worked, but when i set a Target Folder i get a server error:
    Access to the path 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 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 and IIS 7, and the configured application pool identity on IIS 7.5) 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 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.

    I think the error is when the file is moved from the temporary folder to the target folder but i don't know what is the reason.


  7. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 24 Apr 2013 Link to this post

    Hi Alejandro,

    When TargetFolder is set the RadAsyncUpload moves the uploaded files from the TemporaryFolder to the TargetFolder on postback. From the provided error description it seems that you do not have access (permissions) to the target folder. Here is a description how those permissions could be set:
    To grant ASP.NET access to a folder, right-click on the folder, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Check the box for full control.

    Regards,
    Peter Filipov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  8. Alejandro
    Alejandro avatar
    4 posts
    Member since:
    Nov 2012

    Posted 24 Apr 2013 Link to this post

    Thanks Peter,
    Finally i got the solution for the issue, it was the permissions for the Target Folder as you told me, the problem was i had made the changes on the permissions by the panel from my web server and i was assuming the panel change the permissions as i needed but it didn't. After changing manually the permissions in the folders on the server i finally got it right and the RadAsyncUpload works perfect.
    Best Regards.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017