locked
exe file not opening in production server RRS feed

  • Question

  • User1804579801 posted

    I have a exe  file which works local but after uploading in  production server iam getting

    "404 - File or directory not found."

    The site is hosted in IIS version7

    I have tried with changing webconfig setting

    <system.webServer>

    <handlers>
    <add name="Client exe" path="*.exe" verb="*" modules="StaticFileModule" resourceType="File"/>
    </handlers>

    </system.webServer>

    I have developed application in Vs 2013

    Wednesday, September 26, 2018 11:51 AM

All replies

  • User753101303 posted

    Hi,

    It could be that you need a change to https://docs.microsoft.com/en-us/iis/configuration/system.webserver/staticcontent/mimemap (IIS doesn't allow to download non registered mime types).

    What are you trying to do ? It is unusual. You try to have users downloading and running an EXE file on their machine ? Or it should run server side to create an HTML output ?

    Wednesday, September 26, 2018 12:29 PM
  • User1804579801 posted

    Hi,

    My requirement is online test portal were for secure browser we are opening the site within exe using webbrowser control in asp.net windows application

    now when iam accessing my file

    UAT site url/App/myfile.exe

    App is the folder in the UAt site Iam getting 404 error

    previously this code was there in webconfig

    <system.webServer>
    <directoryBrowse enabled="false" />
    <handlers accessPolicy="Read, Script">

    <remove name="CGI-exe" />
    <add name="CGI-exe" path="*.exe" verb="*" modules="CgiModule" resourceType="File" requireAccess="Execute" allowPathInfo="true" />

    </handlers>

    </system.webServer>

    My trials done but not working

    1) checked this url https://docs.microsoft.com/en-us/iis/configuration/system.webserver/security/requestfiltering/fileextensions/ and added request filter but does not work

    in web config

    <system.webServer>

    <security>
    <requestFiltering>
    <fileExtensions>
    <add fileExtension=".exe" allowed="true" />
    </fileExtensions>
    </requestFiltering>
    </security>

    </system.webServer>

    2)trial 2

    Go to IIS > Sites > example.com > HandlerMappings . Find CGI-exe handler and click on Edit Feature Permissions  Un-check Execute permission and click OK

    3)trial 3:MIME types  https://docs.microsoft.com/en-us/iis/configuration/system.webserver/staticcontent/mimemap

    in web config


    <system.webServer>
    <staticContent>
    <mimeMap fileExtension=".exe" mimeType="application/octet-stream" /> </staticContent>
    </system.webServer>

    Please help me to solve this problem the same application developed in vs 2010 with the exe downloadable link is working not working in vs 2013
    My production server details:
    IIS-7
    operating system:Windows Server 2008 R2 Standard.
    Wednesday, September 26, 2018 1:35 PM
  • User753101303 posted

    we are opening the site within exe using webbrowser control in asp.net windows application

    I don't really get it. How do you launch this exe ? My understanding is that you are trying to download an EXE from a web site that would run on the local machine to show a web site (the same one ?) inside a webbrowser control ? What if someone just uses a browser. This is for controlled users ?

    It seems,complicated if even possible and I'm not sure to get which benefits it brings...

    Are you sure it is supposed to work? Sometimes things seems to work locally because you are in the very special case where both the web browser and the web server is on the same machine but it will never run on a real machine.

    Wednesday, September 26, 2018 2:16 PM
  • User1804579801 posted

    "My understanding is that you are trying to download an EXE from a web site that would run on the local machine to show a web site (the same one ?) inside a webbrowser control"

    Yes you are right when i click my UAT url  http://mysite.mycompany.com/securelogin.aspx 

    I will be redirected to a page were to access the test I should download an exe file and click on it to take online test  so when I click on the exe iam getting the error 404.

    It seems,complicated if even possible and I'm not sure to get which benefits it brings...:Our moto is candidate should not be able to access any browser ,no right click ,no print screen options will be disabled through code.only he can take test or exit from the screen.

    So Now Please help me in solving my issue of 404 file not found in previous post I ahave already given my trial methods which i tried to solve the issue .

    Thursday, September 27, 2018 6:51 AM
  • User753101303 posted

    So my first try would be to add a mime type for exe files. IIS doesn't serve a file that is not explicitely registered in its mime type lists.

    As it seems too happen on controlled machines, it seems it could be installed directly on each machine ? Similarly they could be configured to access an internal test site without giving access to the internet...

    Thursday, September 27, 2018 7:04 AM
  • User1804579801 posted

    MIME Types for exe files I already given in the site event then it does not work tried all the trials in the previous post

    Please help to solve the issue

    .exe application/octet-stream

    .exe.config text/xml

    Thursday, September 27, 2018 11:07 AM
  • User753101303 posted

    And this file is in which directory ? For example downloading from App_Data directory is blocked by design. Then check maybe your antivirus and/or firewall software.

    You could also maybe check the IIS log to find which 404.x status code among those shown at https://support.microsoft.com/en-us/help/943891/the-http-status-code-in-iis-7-0-iis-7-5-and-iis-8-0

    Thursday, September 27, 2018 1:44 PM