Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to disable or remove the "Open" option [file download window ]

How to disable or remove the "Open" option [file download window ]

Scheduled Pinned Locked Moved ASP.NET
questionhelptutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jay_se
    wrote on last edited by
    #1

    How do I disable or remove the "Open" option in the file download window in my aspx page? Can somebody please help? Thanks! I have been used the below code in my page.... That's why, there is no file in my Cache. Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1)); Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Cache.SetNoStore();

    Jey

    V 1 Reply Last reply
    0
    • J Jay_se

      How do I disable or remove the "Open" option in the file download window in my aspx page? Can somebody please help? Thanks! I have been used the below code in my page.... That's why, there is no file in my Cache. Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1)); Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Cache.SetNoStore();

      Jey

      V Offline
      V Offline
      Vasudevan Deepak Kumar
      wrote on last edited by
      #2

      You might not have that much control over the File Download dialog box as it is fully controlled by the web browser. To trigger the dialog, I guess, you should be using Content-Disposition with the full file name like (filename.xls) [including the extension right]. You can tweak the headers and try sending the MimeType which is that of EXE. Normally, for Security reasons, Internet Explorer disables 'Open' for EXE and also the 'Checkbox' right? But this might not be a complete solution neither a cross-browser compatible one.

      Vasudevan Deepak Kumar Personal Homepage Tech Gossips

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups