We are excited to announce that the IIS.NET Forums are moving to the new Microsoft Q&A experience. Learn more >

Why when I download a file for example file.csv, it adds the extension _ASP.NET. The resulting file is called file.csv _ASP.NETRSS

3 replies

Last post Apr 07, 2021 08:56 AM by samwu

  • Why when I download a file for example file.csv, it adds the extension _ASP.NET. The resulting fi...

    Mar 31, 2021 12:41 AM|malborarg2|LINK

    I am using an application that runs on IIS 8.5. When the app generates an exportable list, and I try to download the file (which can be a .csv or .pdf) something renames it as XXXX.csv_ASP.NET. The same program running in another IIS works ok. So it is not the program but some configuration in my IIS.Thnks in advance
  • Re: Why when I download a file for example file.csv, it adds the extension _ASP.NET. The resultin...

    Apr 01, 2021 02:39 AM|samwu|LINK

    Hi malborarg2,

    malborarg2

    I am using an application that runs on IIS 8.5. When the app generates an exportable list, and I try to download the file (which can be a .csv or .pdf) something renames it as XXXX.csv_ASP.NET. The same program running in another IIS works ok. So it is not the program but some configuration in my IIS.

    Will it add the extension _ASP.NET when you run the application locally? or you can try another browser.

    Can you show me your web.config file?

    Best regards,

    Sam

    IIS.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today. Learn more >
  • Re: Why when I download a file for example file.csv, it adds the extension _ASP.NET. The resultin...

    Apr 03, 2021 05:39 PM|malborarg2|LINK

    Hi Sam, thanks fot take my case.  It happen in any browser.  But I have the same application in diff´rent servers. And it work well in other servers.  I dont know much about IIS. But I think must be some configuration in IIS, or .net framework. I dont know.

    My config is this:

    <?xml version="1.0" encoding="UTF-8"?>
    <!--
    Web.config file for XXX.

    The settings that can be used in this file are documented at 
    http://www.mono-project.com/Config_system.web and 
    http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx
    -->
    <configuration>
        <system.web>
            <compilation defaultLanguage="C#" debug="true">
                <assemblies>
                    <add assembly="System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
                    <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
                    <add assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
                    <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
                    <add assembly="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
                    <add assembly="System.Windows.Forms, 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.Drawing, 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.Web.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
                    <add assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /></assemblies>
            </compilation>
            <customErrors mode="Off" />
            <authentication mode="Forms">
                <forms loginUrl="~/Index.aspx" defaultUrl="~/Internas.aspx" timeout="2880" />
            </authentication>
            <authorization>
                <allow users="*" />
            </authorization>
            <httpHandlers>
                <add path="ChartImg.axd" verb="GET,HEAD" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false" />
            </httpHandlers>

            <machineKey validation="AES" />
            
            <trace enabled="true" localOnly="true" pageOutput="false" requestLimit="10" traceMode="SortByTime" />
            <sessionState mode="InProc" cookieless="false" timeout="20" />
            <globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="es-AR" />
            <pages theme="TGAdmin" styleSheetTheme="TG" validateRequest="false">
                <controls>
                    <add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" />
                </controls></pages>
            <httpRuntime requestValidationMode="2.0" executionTimeout="600" maxRequestLength="30486" useFullyQualifiedRedirectUrl="false" minFreeThreads="8" minLocalRequestFreeThreads="4" appRequestQueueLimit="100" enableVersionHeader="true" enableKernelOutputCache="false" />
        </system.web>
        <runtime>
            <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
                <dependentAssembly>
                    <assemblyIdentity name="Microsoft.WindowsAzure.Storage" publicKeyToken="31bf64e35" culture="neutral" />
                    <bindingRedirect oldVersion="0.0.0.0-2.1.0.4" newVersion="2.1.0.4" />
                </dependentAssembly>
            </assemblyBinding>
        </runtime>
      
      <appSettings>
            <add key="connection_string" value="Qy3wJpe3I13P84EC9vnw21L6FsUNPdiaBa/P/kU+PfRhYMdct9Fh2HoOWGI/1BYx0jHW08ifDXplm+kNP+Qqv2A9AIy2DgVoiAn7NlMZj4y7xn9X28tBFTkRVFIa0s6+qvm7wG+wf6lfhRqT6TMMUULpAZfJuFr9CAdjS3vINnRlpfp8cNIWc0c6uq3pmqvIcW/9d1DM4J7+1zJhuRGsd85gc3QmCe7VlFoxQrBdOF+1NqkVGkiC7vdXL7MZXxJW88GYQfqMj+ilwWxIxOB735O8GE9Uo1Sa2SepShOs/Y"></add>
            <add key="production_connection_string" value="Qy3wJpe3I13P84EC9vnw21L6FsUNPdiaBa/P/qU+PfRhYMdct9Fh2HoOWGI/1BYx0jHW08ifDXplm+kNP+Qqv2A9AIy2DgVoiAn7NlMZj4y7xn9X28tBFTkRVFIa0s6+qvm7wG+wf6lfhRqT6TMMUULpAZfJuFr9CAdjS3vINnRlpfp8cNIWc0c6uq3pmqvIcW/9d1DM4J7+1zJhuRGsd85gc3QmCe7VlFoxQrBdOF+1NqkVGkiC7vdXL7MZXxJW88GYQfqMj+ilwWxIxOB735O8GE9Uo1Sa2SepShOs/Y"></add>
            <add key="ConnectionAmount" value="3" />
            <add key="RootDirectory" value="/TGXXXX/" />
            <add key="CountryCode" value="54" />
            <add key="PrinterURL" value="http://192.168.1.64:57220/tmu220a/" />
            <add key="UnrestrictedPayment" value="false" />
            <add key="httpPrinter" value="false" />
            <add key="Repository" value="~/files/" />
            <!-- Muestra/Oculta los reportes (con replica igual 1) en el menú. -->
            <add key="Replica" value="0" />
            <!-- Las tablas evento_terminal y tipo_evento estan en esta base. -->
            <add key="EventsDatabase" value="xxxx" />
            <!-- Las tablas de auditoria estan en esta base. -->
            <add key="AuditDatabase" value="XXXX" />
            <!-- En caso de ser réplica se usa la tabla usuario de esta base. -->
            <add key="ProductionDatabase" value="XXXX" />
            <add key="ChartImageHandler" value="storage=file;timeout=20;dir=c:\TempImageFiles\;" />
            <add key="DirectoryBackup" value=""></add>
            <add key="aspnet:MaxHttpCollectionKeys" value="1000000" />
        </appSettings>
        
        <system.webServer>
            <httpProtocol>
              <customHeaders>
                <add name="X-Frame-Options" value="DENY" />
              </customHeaders>
            </httpProtocol>
            <defaultDocument>
                <files>
                    <remove value="default.aspx" />
                    <remove value="iisstart.htm" />
                    <remove value="index.html" />
                    <remove value="index.htm" />
                    <remove value="Default.asp" />
                    <remove value="Default.htm" />
                    <add value="Index.aspx" />
                </files>
            </defaultDocument>
        </system.webServer>
     
    </configuration>

    Look image here:

    https://ibb.co/mTjYdmF 

    Thanks in advance !!!

  • Re: Why when I download a file for example file.csv, it adds the extension _ASP.NET. The resultin...

    Apr 07, 2021 08:56 AM|samwu|LINK

    Hi malborarg2,

    The cause of the problem was not found from your web.config, 

    You need to use failed request tracking to view the request process, the specific step adds the extension _ASP.NET.

    https://docs.microsoft.com/en-us/iis/extensions/url-rewrite-module/using-failed-request-tracing-to-trace-rewrite-rules

    Best regards,

    Sam

    IIS.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today. Learn more >