Integrating RadUpload with SharePoint 2010 - HTTP 404

Thread is closed for posting
6 posts, 0 answers
  1. Marek
    Marek avatar
    3 posts
    Member since:
    Dec 2011

    Posted 30 Dec 2011 Link to this post

    Hello,

    In order to integrate RadUpload control with SharePoint 2010 (IIS 7.5) I wrote an application page MyCustomUpload.aspx:
    <%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
    <%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
    <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
    <%@ Register Tagprefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI, Version=2011.3.1115.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" %>
    <%@ Import Namespace="Microsoft.SharePoint" %>
    <%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MyCustomUpload.aspx.cs" Inherits="LargeFileUploadSP.Layouts.LargeFileUploadSP.MyCustomUpload" DynamicMasterPageFile="~masterurl/default.master" %>
     
    <asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
     
    </asp:Content>
     
    <asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
        <telerik:RadProgressManager ID="Radprogressmanager1" runat="server" />
         
        <table>
            <tr>
                <td>
                    <telerik:RadUpload ID="RadUpload1" runat="server" />
                </td>
                <td>
                    <div>
                        <asp:Label ID="labelNoResults" runat="server" Visible="True">No uploaded files yet</asp:Label>
                        <asp:Repeater ID="repeaterResults" runat="server" Visible="False">
                            <HeaderTemplate>
                                <div>Uploaded files in the target folder:</div>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <%#DataBinder.Eval(Container.DataItem, "FileName")%>
                                <%#DataBinder.Eval(Container.DataItem, "ContentLength").ToString() + " bytes"%>
                                <br />
                            </ItemTemplate>
                        </asp:Repeater>
                    </div>
                </td>
            </tr>
        </table>
     
        <div class="submitArea">
            <asp:Button runat="server" ID="SubmitButton" Text="Upload files" OnClick="SubmitButton_Click" />
        </div>
        <telerik:RadProgressArea runat="server" ID="ProgressArea1">
        </telerik:RadProgressArea>
    </asp:Content>
     
    <asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
    My custom upload page
    </asp:Content>
     
    <asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server" >
    My custom upload page
    </asp:Content>

    with code behind cs:

    using System;
    using Microsoft.SharePoint;
    using Microsoft.SharePoint.WebControls;
    using System.Web.UI;
    using Telerik.Web.UI;
     
    namespace LargeFileUploadSP.Layouts.LargeFileUploadSP
    {
        public partial class MyCustomUpload : LayoutsPageBase
        {
            private ScriptManager scriptManager;
             
            protected void Page_Load(object sender, EventArgs e)
            {
                RadUpload1.TargetPhysicalFolder = @"C:\telerik_uploads\";
            }
     
            protected void SubmitButton_Click(object sender, EventArgs e)
            {
                if (RadUpload1.UploadedFiles.Count > 0)
                {
                    repeaterResults.DataSource = RadUpload1.UploadedFiles;
                    repeaterResults.DataBind();
                    labelNoResults.Visible = false;
                    repeaterResults.Visible = true;
                }
                else
                {
                    labelNoResults.Visible = true;
                    repeaterResults.Visible = false;
                }
            }
        }
    }

    I'm using the standard .net ScriptManager provided in default SP master page.
    I was able to upload files with no additional configuration but no progress bar was displayed and I received a warning pop-up every time the file was uploaded. Following these instructions (for IIS7): http://www.telerik.com/help/aspnet-ajax/moss-progress-area-in-moss.html and http://www.telerik.com/help/aspnet/upload/uploadinglargefiles.html I configured the progress handler and upload limits.

    Here are some parts of my web.config file (for SP web app):

    <system.webServer>
        <security>
            <requestFiltering allowDoubleEscaping="true">
                <requestLimits maxAllowedContentLength="2147483647" />
            </requestFiltering>
        </security>
        ...
        <httpRuntime maxRequestLength="1024000" executionTimeout="3600" />
        ...
        <modules runAllManagedModulesForAllRequests="true">
            ...
            <!-- For Telerik RadUpload control -->
            <add name="RadUploadHttpModule" type="Telerik.Web.UI.SPRadUploadHttpModule, Telerik.Web.UI, Version=2011.3.1115.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" preCondition="integratedMode" />
        </modules>
        <handlers>
            ...
            <!-- For Telerik RadUpload control -->
            <add path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler, Telerik.Web.UI, Version=2011.3.1115.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" verb="*" preCondition="integratedMode" name="Telerik_RadUploadProgressHandler_ashx" />
        </handlers>
    </system.webServer>
    <location path="Telerik.RadUploadProgressHandler.ashx">
        <system.web>
            <authorization>
                <allow users="*"/>
            </authorization >
        </system.web>
    </location>
    <location path="WebResource.axd">
        <system.web>
            <authorization>
                <allow users="*"/>
            </authorization >
        </system.web>
    </location>
    <location path="Telerik.Web.UI.WebResource.axd">
        <system.web>
            <authorization>
                <allow users="*" />
            </authorization>
        </system.web>
    </location>

    I've also changed the C:\Windows\System32\inetsrv\config\applicationHost.config file as described in documentation:

    <section name="requestFiltering" overridemodedefault="Allow" />

    in all sectionGroups where it occurred.

    Now when I'm trying to upload a file I get 404 and no files are uploaded to target folder.

    Logs from IIS:

    --- begin ---

    2011-12-30 12:25:28 fe80::f158:8004:66bb:fd69%11 GET /sites/test/Telerik.RadUploadProgressHandler.ashx RadUrid=b09a2128-86c0-4f8c-adae-9479c2da54ef&RadUploadTimeStamp=1325247928752& 10001 - fe80::f158:8004:66bb:fd69%11 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+6.1;+WOW64;+Trident/4.0;+SLCC2;+.NET+CLR+2.0.50727;+.NET+CLR+3.5.30729;+.NET+CLR+3.0.30729;+.NET4.0C;+.NET4.0E) 401 1 2148074254 1
    2011-12-30 12:25:28 fe80::f158:8004:66bb:fd69%11 POST /sites/test/_layouts/LargeFileUploadSP/MyCustomUpload.aspx RadUrid=b09a2128-86c0-4f8c-adae-9479c2da54ef 10001 - fe80::f158:8004:66bb:fd69%11 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+6.1;+WOW64;+Trident/4.0;+SLCC2;+.NET+CLR+2.0.50727;+.NET+CLR+3.5.30729;+.NET+CLR+3.0.30729;+.NET4.0C;+.NET4.0E) 401 1 2148074254 14
    2011-12-30 12:25:28 fe80::f158:8004:66bb:fd69%11 GET /sites/test/Telerik.RadUploadProgressHandler.ashx RadUrid=b09a2128-86c0-4f8c-adae-9479c2da54ef&RadUploadTimeStamp=1325247928752& 10001 DEVMM\Administrator fe80::f158:8004:66bb:fd69%11 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+6.1;+WOW64;+Trident/4.0;+SLCC2;+.NET+CLR+2.0.50727;+.NET+CLR+3.5.30729;+.NET+CLR+3.0.30729;+.NET4.0C;+.NET4.0E) 200 0 0 14
    2011-12-30 12:25:28 fe80::f158:8004:66bb:fd69%11 POST /sites/test/_layouts/LargeFileUploadSP/MyCustomUpload.aspx RadUrid=b09a2128-86c0-4f8c-adae-9479c2da54ef 10001 DEVMM\Administrator fe80::f158:8004:66bb:fd69%11 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+6.1;+WOW64;+Trident/4.0;+SLCC2;+.NET+CLR+2.0.50727;+.NET+CLR+3.5.30729;+.NET+CLR+3.0.30729;+.NET4.0C;+.NET4.0E) 404 0 0 117

    --- end ---

    I've read some posts on this forum related with RadUpload and http 404 problems but none of them were helpful in my case.

    Could you please help me to solve this problem?

    Best regards
    Marek Mierzwa
  2. Kalina
    Admin
    Kalina avatar
    918 posts

    Posted 04 Jan 2012 Link to this post

    Hello Marek,

    The issue that you describe is very strange.

    What is the warning pop-up that you have received every time the file was uploaded?
    Can you explain your scenario in more details - I suppose that you are trying to upload very large files?
    Could you please remove the applicationHost.config setting, use the FiddlerCap to record the traffic to your page while you reproduce the issue and then send the log file within a support ticket?

    Greetings,
    Kalina
    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. Marek
    Marek avatar
    3 posts
    Member since:
    Dec 2011

    Posted 13 Jan 2012 Link to this post

    Hello Kalina,

    As I wrote the warning pop-up was displayed before I registered RadUpload handlers in web.config (but then I was still able to upload the file despite the progress bar was not visible). The message was:

    "RadUpload Ajax callback error. Source url was not found:
    ../../Telerik.RadUploadProgressHandler.ashx?RadUrid=<some-uuid-here>
    Did you register RadUploadProgressHandler in web.config?
    Please, see the help for more details: ..."


    After change in web.config and applicationHost.config that I described in previous post I've started to experience 404 problem. After I've commented out the module and handler declaration in web.config the situation is like in the beginning - no progress, warning pop-up is displayed and file is being uploaded successfully to target folder.

    My target file size is 2GB but during tests uploads were failing even for small files (20KB).

    I changed back applicationHost.config file as you suggested but the problem remains - IIS returns 404. I will send you the logs from Fiddler in support ticket.

    Best regards
    Marek
  5. Kalina
    Admin
    Kalina avatar
    918 posts

    Posted 18 Jan 2012 Link to this post

    Hello,

    Let me suggest you continue our communication within the support ticket that you have opened.

    Regards,
    Kalina
    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. Marek
    Marek avatar
    3 posts
    Member since:
    Dec 2011

    Posted 24 Jan 2012 Link to this post

    Hello Kalina,

    The solution with RadAsyncUpload used instead of RadUpload works great! Thank you.

    Best regards
    Marek Mierzwa
  7. Gaurav
    Gaurav avatar
    1 posts
    Member since:
    Oct 2015

    Posted 26 Oct 2015 Link to this post

    Using RadAsyncUpload i am not able to access selected files in code behind

    I am always getting UploadedFiles count as 0.

     Please suggest

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017