AjaxfileUpload error

This was happening to me, and I did two things to fix it:

1) Update your site's web.config file to contain entries for the following:

<system.web>
  <httpHandlers>
    <add verb="*" path="AjaxFileUploadHandler.axd" type="AjaxControlToolkit.AjaxFileUploadHandler, AjaxControlToolkit" />
  </httpHandlers>
</system.web>
<system.webServer>
  <handlers>
    <add name="AjaxFileUploadHandler" verb="*" path="AjaxFileUploadHandler.axd" type="AjaxControlToolkit.AjaxFileUploadHandler, AjaxControlToolkit" />
  </handlers>
</system.webServer>

2) If the page you're uploading from is inside a folder with it's own web.config with deny anonymous authorization rules, make sure you add an allow for the AjaxFileUploadHandler like so:

<location path="AjaxFileUploadHandler.axd">
  <system.web>
    <authorization>
      <allow users="*"/>
    </authorization>
  </system.web>
</location>

Tags:

C#

Asp.Net