AjaxControlToolkit AjaxFileUpload cannot load IIS reserved types

I am writing / writing a file upload file for my company that requires uploading a ton of different types of files of varying size and quantity. I used the AjaxControlToolkit AjaxFileUpload control.

The download works well, except when we download what looks like the IIS reserved file types. We can upload images, entire folders without ZIP archives, office documents, etc.

When I try to download a reserved file type, Firefox developer tools return server error, "File extension not allowed" error. This happens with the .exe files and the ones we need .stl files (in our case, it's for 3D printing).

We've been playing around with config files, handler mappings, HTTP response headers, MIME configurations and request filtering in IIS manager at the application level, site level, and server level, and none of them work.

The last bit of information is that the firmware of the file appears to be going through, but we wish we hadn't been asked to do so by the user.

IIS 8.5, C # .Net, Windows Server 2012 R2

I can post the code if you need it, but I'm sure this is the server config we need to change

Thank you for your help.

Walt

Edit: Below is My Configuration with Fix enabled. this is an issue with white listed file types using the control, not the server. Thanks you

<?xml version="1.0"?>
<configuration>
  <configSections>
    <section name="ajaxControlToolkit" type="AjaxControlToolkit.AjaxControlToolkitConfigSection, AjaxControlToolkit" requirePermission="false"/>
  </configSections>
  <appSettings/>
  <ajaxControlToolkit additionalUploadFileExtensions="bmp,stl"></ajaxControlToolkit>
  <system.webServer>
    <handlers>
      <add name="aa2" verb="*" path="AjaxFileUploadHandler.axd" type="AjaxControlToolkit.AjaxFileUploadHandler, AjaxControlToolkit"/>
    </handlers>  
  </system.webServer>
  <system.web>
    <compilation debug="true">
      <assemblies>
        <add assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Web.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Data.Services.Client, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Data.Services.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
      </assemblies>
    </compilation>
    <pages>
      <controls>
        <add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit"/>
      </controls>
    </pages>
  </system.web>
</configuration>

      

+3


source to share


2 answers


You need to add the attribute additionalUploadFileExtensions

to the section ajaxControlToolkit

in Web.config:

<ajaxControlToolkit additionalUploadFileExtensions="exe,stl" />

      



Please refer to this article: https://github.com/DevExpress/AjaxControlToolkit/wiki/AjaxFileUpload-setup

+2


source


For an example of where the ajaxcontroltoolkit entry in the web.config follows, see Ajax Web.config Configuration Example

See example below:



<configuration>
  <configSections>
    <section name="ajaxControlToolkit" type="AjaxControlToolkit.AjaxControlToolkitConfigSection, AjaxControlToolkit" requirePermission="false"/>
  </configSections>
  <ajaxControlToolkit
    useStaticResources="true"
    renderStyleLinks="false"
    htmlSanitizer="AjaxControlToolkit.HtmlEditor.Sanitizer.DefaultHtmlSanitizer, AjaxControlToolkit.HtmlEditor.Sanitizer"
    tempFolder="~/Temp"/>
  <location path="Temp">
    <system.webServer>
      <handlers>
        <clear/>
      </handlers>
      <modules>
        <clear/>
      </modules>
    </system.webServer>
  </location>
<system.web>

      

0


source







All Articles