Error while uploading, HTTP Error code is: 500 while uploading file in RadAsynUpload Control

8 posts, 0 answers
  1. DotMax
    DotMax avatar
    9 posts
    Member since:
    Jan 2015

    Posted 21 May 2015 Link to this post

    I have all the handlers and modules registered in my web.config. But I still get "Error while uploading, HTTP Error code is: 500" error in RadAsyncUpload method.

     

    I have checked all the Telerik Demos and all the demos have all other code samples except Web.config.

     

    Here are my four different web.config entries.

     <httpHandlers>
           <add verb="*" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.Upload.RadUploadProgressHandler, Telerik.Web.UI"/>
          <add verb="*" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler, Telerik.Web.UI, Culture=neutral, PublicKeyToken=121fae78165ba3d4"/>
          <add verb="*" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler, Telerik.Web.UI, Culture=neutral, PublicKeyToken=121fae78165ba3d4"/>
          <add verb="*" path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler, Telerik.Web.UI, Culture=neutral, PublicKeyToken=121fae78165ba3d4" validate="false"/>
          <add path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI"/>
        </httpHandlers>

        <httpModules>     
          <add name="WindowsAuthentication" type="System.Web.Security.WindowsAuthenticationModule" />
           <add name="RadCompression" type="Telerik.Web.UI.RadCompression"/>
          <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule, Telerik.Web.UI"/>   
        </httpModules>

     

     <handlers>
          <add name="aspnet_isapi" path="*" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="None" preCondition="classicMode,runtimeVersionv2.0,bitness32" />
          <add name="ChartImage.axd_*" path="ChartImage.axd" verb="*" type="Telerik.Web.UI.ChartHttpHandler, Telerik.Web.UI, Culture=neutral, PublicKeyToken=121fae78165ba3d4" preCondition="integratedMode"/>
          <add name="Telerik.Web.UI.SpellCheckHandler.axd_*" path="Telerik.Web.UI.SpellCheckHandler.axd" verb="*" type="Telerik.Web.UI.SpellCheckHandler, Telerik.Web.UI, Culture=neutral, PublicKeyToken=121fae78165ba3d4" preCondition="integratedMode"/>
          <add name="Telerik.Web.UI.DialogHandler.aspx_*" path="Telerik.Web.UI.DialogHandler.aspx" verb="*" type="Telerik.Web.UI.DialogHandler, Telerik.Web.UI, Culture=neutral, PublicKeyToken=121fae78165ba3d4" preCondition="integratedMode"/>
          <add name="Telerik.RadUploadProgressHandler.ashx_*" path="Telerik.RadUploadProgressHandler.ashx" verb="*" type="Telerik.Web.UI.Upload.RadUploadProgressHandler, Telerik.Web.UI" preCondition="integratedMode"/>
          <add name="Telerik.Web.UI.WebResource.axd_*" path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI" preCondition="integratedMode"/>
        </handlers>
        <modules runAllManagedModulesForAllRequests="true">      
         <add name="RadCompression" type="Telerik.Web.UI.RadCompression"/>
          <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule, Telerik.Web.UI" preCondition="managedHandler"/>
        </modules>

     

    What can be the issue? When I do F12 and try to upload the file, it red errors out on ScriptResource.axd file with "Error while uploading, HTTP Error code is: 500".

  2. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 26 May 2015 Link to this post

    Hello Shaik,

    In order to reproduce and investigate the issue could you please send me a sample project with the RadAsyncUpload and your configuration?

    I will be glad to assist you further.

    Regards,
    Peter Filipov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. DotMax
    DotMax avatar
    9 posts
    Member since:
    Jan 2015

    Posted 26 May 2015 in reply to Peter Filipov Link to this post

    It's our Enterprise app, so cant update it here. 

    Our Master Page has a Script Manager, so I didnt use another scriptmanager for Radcontrols in my aspx page.

     

    Here is my scriptmanager piece in Master page.

      <asp:ScriptManager ID="ScriptManagerMain" runat="server" EnablePageMethods="true"
                EnablePartialRendering="true" EnableHistory="true" EnableSecureHistoryState="False" AsyncPostBackTimeout="300">

     

    Here is the control I have in my aspx page.

      <telerik:RadAsyncUpload runat="server" ID="RadAsyncUpload1" HttpHandlerUrl="~/FileUpload/FileUpload.ashx"
                OnClientFileUploaded="fileUploaded" OnClientFileUploadRemoving="fileUploadRemoving"
                MultipleFileSelection="Disabled" AllowedFileExtensions="jpeg,jpg,gif,png,bmp" Width="500px" />
            <div class="imageContainer"></div>

     

    Here is the Javascript file.

    (function () {
      var $;
      var demo = window.demo = window.demo || {};

      demo.initialize = function () {
        $ = $telerik.$;
      };


      window.fileUploaded = function (sender, args) {
        var id = args.get_fileInfo().ImageID;

        $(".imageContainer")
            .html("")
            .append($("<img />")
            .attr("src", getImageUrl(id)));

        $(".info").html(String.format("<strong>{0}</strong> successfully inserted.<p>Record ID - {1}</p>", args.get_fileName(), id));

      };

      window.getImageUrl = function (id) {
        var url = window.location.href;
        var handler = "FileQuery.ashx?imageID=" + id;
        var index = url.lastIndexOf("/");
        var completeUrl = url.substring(0, index + 1) + handler;
        return completeUrl;
      };

      window.fileUploadRemoving = function (sender, args) {
        var index = args.get_rowIndex();
        $(".imageContainer img:eq(" + index + ")").remove();
      };
    })();

  5. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 28 May 2015 Link to this post

    Hi Shaik,

    I have tested the provided code at my side and everything is working fine. Could you try to debug the implementation of the custom handler and check from the problem comes?

    Regards,
    Peter Filipov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  6. DotMax
    DotMax avatar
    9 posts
    Member since:
    Jan 2015

    Posted 28 May 2015 in reply to Peter Filipov Link to this post

    Custom handler is not a problem. Problem occurs in ScriptResource.axd while debugging the Java script in F12 mode.

    Custtom handler registration is not correct and I am not sure what else need to be added back. I would recommend you to come up with a page with Master page and Master page should have Script Manager and calls to all the Js files. then using RadAsyncUpload control in the aspx page. I would like to see how does it work?

    If I do as a separate project, it works fine for me too.

     

    I would also recommend you to give all the possible cause and solution to "Error while uploading, HTTP Error code is: 500" from ScriptResource.axd  file while uploading.

     

    None of your demo have web.config registration details.

  7. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 01 Jun 2015 Link to this post

    Hi,

    I have setup a sample project for you. Could you please test it and let me know if it works at your side.

    Regards,
    Peter Filipov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  8. DotMax
    DotMax avatar
    9 posts
    Member since:
    Jan 2015

    Posted 03 Jun 2015 in reply to Peter Filipov Link to this post

    Thank You. It works well. But Can you let me know with hte JQuery files reference? None of these client side coding is working with JQuery 2.1.3 in IE 11.
  9. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 08 Jun 2015 Link to this post

    Hi Shaik,

    Keep in mind that our controls are supporting jQuery 1.9.1. In case that you want to use different version for handling client side events there should be no problem. 

    Regards,
    Peter Filipov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017