AjaxFileUploadHandler.axd coming up 404

2.3k Views Asked by At

I'm editing the original post because I've figured a few things out, so my question can be more specific.

I'm working with the AjaxControlToolkit and Visual Studio 2015 Community edition. I used NuGet to install the toolkit and the Html Sanitizer they suggested.

Now, I set up a web forms ASP.NET page containing the HtmlEditorExtender control, and it works fine except for the embedded AjaxFileUpload control.

The upload is failing, and I included the console output below to show what I get.

Console Log Messages

It appears that the error comes because the app can't find the AjaxFileUploadHandler.axd file (that's what the more descriptive version of the console message is). I tried all of the suggestions I could find about modifying the web.config file (here are the relevant sections):

  <system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<handlers>
  <add name="AjaxFileUploadHandler" verb="*" path="AjaxFileUploadHandler.axd" type="AjaxControlToolkit.AjaxFileUploadHandler, AjaxControlToolkit" />
</handlers>
<security>
  <requestFiltering>
    <requestLimits maxAllowedContentLength="4294967295" />
  </requestFiltering>
</security>

and...

<system.web>
<trust level="Full" />
<httpHandlers>
  <add verb="*" path="AjaxFileUploadHandler.axd" type="AjaxControlToolkit.AjaxFileUploadHandler, AjaxControlToolkit" />
</httpHandlers>

I've uninstalled the toolkit, rebooted the server, tried everything I could find on it, and yet still no joy. I'm out of ideas here. Any help from anyone, please?

2

There are 2 best solutions below

3
Mikhail Tymchuk On

If you host your application no at the root of a web site, you need to specify a path to the AjaxFileUploadHandler.axd that includes all path parts after the site root.

For example, if you host a site at http://mysite/myapp/mypage.aspx you need to define it like that:

<httpHandlers>
    <add verb="*" path="myapp/AjaxFileUploadHandler.axd" type="AjaxControlToolkit.AjaxFileUploadHandler, AjaxControlToolkit" />
</httpHandlers>

You can also see this issue for more details: https://github.com/DevExpress/AjaxControlToolkit/issues/43#issuecomment-203889967

0
Satbir On

Please check that Identity under which you are executing your code has access to the folder.

I encountered the same error, the solution worked fine on local dev machine but when i published it onto server, I got this same error.

Looking at Event logs on the server I realized that i missed to give r/w permissions to the server identity. Once i gave these permissions, it worked fine.