This is a migrated thread and some comments may be shown as answers.

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

9 Answers 549 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
DotMax
Top achievements
Rank 1
DotMax asked on 21 May 2015, 05:41 PM

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".

9 Answers, 1 is accepted

Sort by
0
Peter Filipov
Telerik team
answered on 26 May 2015, 08:26 AM
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
0
DotMax
Top achievements
Rank 1
answered on 26 May 2015, 02:55 PM

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();
  };
})();

0
Peter Filipov
Telerik team
answered on 28 May 2015, 07:42 AM
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
0
DotMax
Top achievements
Rank 1
answered on 28 May 2015, 06:37 PM

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.

0
Peter Filipov
Telerik team
answered on 01 Jun 2015, 08:20 AM
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
0
DotMax
Top achievements
Rank 1
answered on 03 Jun 2015, 03:38 PM
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.
0
Peter Filipov
Telerik team
answered on 08 Jun 2015, 08:14 AM
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
0
thelostleaf
Top achievements
Rank 2
answered on 29 Mar 2017, 04:47 PM

I was receiving this error (Error 500: Access Denied) even when Handler registered properly in web.config also all rights given to upload folder. The problem was calling a method (inside my custom .ashx handler for the upload async) in a referenced DLL which had an older version of Telerik.Web.Ui.dll. Instead of error in C# side it is in Telerik javascript. Update your Telerik  dlls so all of your referenced dlls are using the same version, or move that offending method into the handler instead of referencing.

0
Miika
Top achievements
Rank 1
Iron
answered on 28 Sep 2022, 11:50 AM

One possible reason:

IIS_USERS (or application pool user) must be granted with modify to APP_DATA\RadUploadTemp folder, event if you are using custom web handler to import images to database.

This appeared to me with version 2022 R2 update, used to work without folder access for several years. (I'v skipped few versions though)
Upload worked in debug machine (since I have rights), but not in production server.

Debug this from server using localhost address (to get errors back).
Open Firefox. press F12 to open console -> try to upload file -> "open" error in console - response tab showed clearly, that folder permissions were missing. (Firefox has "request/response" tabs inside error, that Chrome and Edge are lacking).

Tags
AsyncUpload
Asked by
DotMax
Top achievements
Rank 1
Answers by
Peter Filipov
Telerik team
DotMax
Top achievements
Rank 1
thelostleaf
Top achievements
Rank 2
Miika
Top achievements
Rank 1
Iron
Share this question
or