| | |
File Download Dialog Box(ASP)
Please support our ASP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jan 2006
Posts: 2
Reputation:
Solved Threads: 0
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 :mrgreen: ,How do I disable any Button on the Dialog box let say the Save button?????? :mrgreen:
You can not disable the boxes. They are part of the browser and there is nothing you can do to disable them.
No code in the world can disable them.
No code in the world can disable them.
•
•
Join Date: May 2006
Posts: 2
Reputation:
Solved Threads: 0
Two comments.
First, I haven't seen the "More" button you mention (running IE 7, XP Professional SP2).
Second, scouring the Web brought me no idea of how to control the buttons individually.
However, regarding Open, I noticed that a client OS that was not configured to recognize the file type being downloaded would not know which environment to open, and therefore would not display the "Open" button--for example, the client displayed the download-file name in the File Download Box but Windows did not seem to recognize .doc files, therefore Windows didn't open the file in Word and did not display the Open button, only Save and Cancel.
Also, I did find some C# code that purported to suppress the Open. VB.NET seemed to recognize the code without changes except dropping the final semicolon. It didn't do the job in my app that the author claimed it did in his, but here's the code:
Response.Cache.SetCacheability (HttpCacheability.NoCache);
First, I haven't seen the "More" button you mention (running IE 7, XP Professional SP2).
Second, scouring the Web brought me no idea of how to control the buttons individually.
However, regarding Open, I noticed that a client OS that was not configured to recognize the file type being downloaded would not know which environment to open, and therefore would not display the "Open" button--for example, the client displayed the download-file name in the File Download Box but Windows did not seem to recognize .doc files, therefore Windows didn't open the file in Word and did not display the Open button, only Save and Cancel.
Also, I did find some C# code that purported to suppress the Open. VB.NET seemed to recognize the code without changes except dropping the final semicolon. It didn't do the job in my app that the author claimed it did in his, but here's the code:
Response.Cache.SetCacheability (HttpCacheability.NoCache);
•
•
Join Date: Jun 2008
Posts: 3
Reputation:
Solved Threads: 0
Try
asp Syntax (Toggle Plain Text)
Dim FilePath As String = Server.MaPath(Folder+filename) Dim FileName As System.IO.FileInfo = New System.IO.FileInfo(FilePath & "\" & lblFileName.Text) ' If FileName.Exists Then Response.Clear() Response.AddHeader("Content-Disposition", "attachment; filename=" & FileName.Name) Response.AddHeader("Content-Length", FileName.Length.ToString()) Response.ContentType = ReturnExtension(FileName.Extension.ToLower()) '"image/jpeg" Response.WriteFile(FileName.FullName) Response.End() 'Else 'Response.Write("This file does not exist.") 'End If Catch ex As Exception lblMsg.Text = ex.Message End Try ' Sub for extension Public Function ReturnExtension(ByVal fileExtentsion As String) As String Select Case fileExtentsion Case ".html", ".htm" Return "text/HTML" Case ".txt" Return "text/plain" Case ".doc" Return "application/ms-word" Case ".tiff" Case ".tif" Return "image/tiff" Case ".asf" Return "video/x-ms-asf" Case ".avi" Return "video/avi" Case ".zip" Return "application/zip" Case ".xls" Case ".csv" Return "application/vnd.ms-excel" Case ".gif" Return "image/gif" Case ".jpg" Case "jpeg" Return "image/jpeg" Case ".bmp" Return "image/bmp" Case ".wav" Return "audio/wav" Case ".mp3" Return "audio/mpeg3" Case ".mpg" Case "mpeg" Return "video/mpeg" Case ".rtf" Return "application/rtf" Case ".asp" Return "text/asp" Case ".pdf" Return "application/pdf" Case ".fdf" Return "application/vnd.fdf" Case ".ppt" Return "application/mspowerpoint" Case ".dwg" Return "image/vnd.dwg" Case ".msg" Return "application/msoutlook" Case ".xml" Case ".sdxl" Return "application/xml" Case ".xdp" Return "application/vnd.adobe.xdp+xml" Case Else Return "application/octet-stream" End Select End Function
Last edited by peter_budo; Sep 2nd, 2008 at 7:21 am. Reason: Keep It Organized - please use [code] tags
![]() |
Similar Threads
- How a doc file can be open inside browser without prompting the download dialog box (ASP.NET)
- File Download Dialog Box(ASP) (ASP)
- file open dialog box control in asp.net (ASP.NET)
- File Download dialog Box Not appearing (Windows NT / 2000 / XP)
- Download Dialog Box (C)
- IE; Getting file download box when attempting to access a particular web page (Web Browsers)
Other Threads in the ASP Forum
- Previous Thread: date() function
- Next Thread: Using INSERT, then DELETE from another table
| Thread Tools | Search this Thread |
Tag cloud for ASP
archive asp asp.net aspandmssqlserver2005 aspandmssqlserver2005connection aspconnection calendar changeable connection current database databaseconnection diagnostics dreamweaver excel fso html iis microsoft msmsql mssql2005 mssqlserver2005 mssqlserver2005andasp mssqlserverandasp opentextfile record searchbox selectoption server single specfic sqlserver sqlserverconnection toolkit web webserver windows7





