File Download Dialog Box(ASP)


I have a ASP Page that allow the users to Download a File @ the Click of the button the File Download Dialog Box will pop up on the Scream ,on the download dialog Box are 4 buttons namely Open ,Save,Cancel and More Info ,How do I disable any Button on the Dialog box let say the Save button??????

Dani AI

Generated

Short answer: you cannot reliably remove or disable the Open / Save / Cancel buttons in the browser's file‑download dialog from Classic ASP (or any server-side code). The download dialog is rendered by the browser/OS and its available options depend on the browser version, user settings and security policies — not on your ASP page. This is why ’s IE-era tweak (the proprietary meta/header trick that older Internet Explorer supported) only worked in limited environments and is not a general solution. (developer.mozilla.org)

Practical server-side approach (what you can control): send correct HTTP headers so the browser treats the response as a download. The usual pattern is to return the file with an appropriate Content-Type and a Content-Disposition hint (attachment to suggest “Save as”, inline to suggest viewing). In Classic ASP use an ADODB.Stream to stream the file and add the Content-Disposition header before writing the bytes. Example (Classic ASP / VBScript):

<%
Dim filePath, fileName, stream
filePath = Server.MapPath("/files/report.pdf")
fileName = "report.pdf"

Set stream = Server.CreateObject("ADODB.Stream")
stream.Type = 1
stream.Open
stream.LoadFromFile filePath

Response.Clear
Response.ContentType = "application/octet-stream"
Response.AddHeader "Content-Disposition", "attachment; filename=""" & fileName & """"
Response.BinaryWrite stream.Read
Response.End

stream.Close
Set stream = Nothing
%>

The Content-Disposition header is the standard way to trigger download behavior; it controls how the browser suggests saving/opening but it does not give per‑button control. (devdoc.net)

Notes about IE-specific and legacy options: Internet Explorer introduced server/meta mechanisms (and an X-Download-Options header) that could suppress the “Open” action in some versions, but that is an IE extension and not a cross‑browser control. Relying on it breaks on non‑IE clients and on modern browsers. If you must harden downloads, use headers (Content-Disposition, X-Content-Type-Options, X-Download-Options where appropriate) and server-side access controls. (stackoverflow.com)

If the goal is to prevent users keeping copies of content, understand the limits: once bytes reach a client, they can be saved, copied or screenshotted. Practical mitigations are authenticated/expiring URLs, streaming to a controlled viewer, watermarking, or DRM solutions — but none are foolproof. Decide which tradeoffs (usability, cost, complexity) you accept. (pvq.app)

Recommended Answers

All 2 Replies

Hi elblazzy4chizzy (!) - welcome to DaniWeb! This forum is for introductions. so if you want help with a technical problem, you might want to post in the forum that best fits your situation. I am not familiar with ASP, but if you check the topics in the Tech Talk forums list, I'm sure you will find one that is a close fit for your post.

Good luck learning how to maneuver around the site - it's actually pretty simple once you get the hang of it. Hope you get your problem figured out - I'm sure someone here knows how to help! ~kAtH

File Download Dialog Box(ASP)


I have a ASP Page that allow the users to Download a File @ the Click of the button the File Download Dialog Box will pop up on the Scream ,on the download dialog Box are 4 buttons namely Open ,Save,Cancel and More Info ,How do I disable any Button on the Dialog box let say the Save button??????

i have partial solution for this


<META name="DownloadOptions" content="noopen">
nosave for save button

but there is no solution for cancel button.
if you use more than one options than the last one will works only.

can any body tell me solution for cancel button?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.