941,512 Members | Top Members by Rank

Ad:
  • ASP Discussion Thread
  • Unsolved
  • Views: 34081
  • ASP RSS
Jan 25th, 2006
0

File Download Dialog Box(ASP)

Expand Post »
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:
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
elblazzy4chizzy is offline Offline
2 posts
since Jan 2006
Jan 25th, 2006
0

Re: File Download Dialog Box(ASP)

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.
Reputation Points: 25
Solved Threads: 7
Junior Poster
Drew is offline Offline
166 posts
since Apr 2004
May 8th, 2006
0

Re: File Download Dialog Box(ASP)

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);
Reputation Points: 10
Solved Threads: 0
Newbie Poster
CrunchyFrog is offline Offline
2 posts
since May 2006
May 9th, 2006
0

Re: File Download Dialog Box(ASP)

So, to second what Drew said--there's no way to control the buttons individually. But there's the exception that Open will appear, or not appear, depending on whether the browser recognizes your file type.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
CrunchyFrog is offline Offline
2 posts
since May 2006
May 23rd, 2006
0

Re: File Download Dialog Box(ASP)

Hi
Can you please give me the codes of the "download Dialogue box' I need to put in on my page so that the user can download a pdf file.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sakshi006 is offline Offline
1 posts
since May 2006
Apr 27th, 2008
0

Re: File Download Dialog Box(ASP)

Hi there,
I too am looking for the codes of the download dialog box. Did you get a reply or and answer?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
BraidedRainbows is offline Offline
1 posts
since Apr 2008
May 26th, 2008
0

Re: File Download Dialog Box(ASP)

i am too looking for the code for file downloading dialog box asp.net using vb.
if any one could help me with it.
thank you
Reputation Points: 10
Solved Threads: 0
Newbie Poster
hiralmehta is offline Offline
3 posts
since May 2008
Aug 24th, 2008
0

download link in my webpage

how i can put download link for image,flash file,other file in my webpage that can other download it ?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
dreemebird is offline Offline
3 posts
since Aug 2008
Aug 24th, 2008
0

Re: File Download Dialog Box(ASP)

how i can put download link for image,flash file,other file in my webpage that can other download it ?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
dreemebird is offline Offline
3 posts
since Aug 2008
Aug 26th, 2008
0

Re: File Download Dialog Box(ASP)

Try
asp Syntax (Toggle Plain Text)
  1. Dim FilePath As String = Server.MaPath(Folder+filename)
  2. Dim FileName As System.IO.FileInfo = New System.IO.FileInfo(FilePath & "\" & lblFileName.Text)
  3. ' If FileName.Exists Then
  4. Response.Clear()
  5. Response.AddHeader("Content-Disposition", "attachment; filename=" & FileName.Name)
  6. Response.AddHeader("Content-Length", FileName.Length.ToString())
  7. Response.ContentType = ReturnExtension(FileName.Extension.ToLower()) '"image/jpeg"
  8. Response.WriteFile(FileName.FullName)
  9. Response.End()
  10.  
  11. 'Else
  12. 'Response.Write("This file does not exist.")
  13.  
  14.  
  15. 'End If
  16. Catch ex As Exception
  17. lblMsg.Text = ex.Message
  18. End Try
  19. ' Sub for extension
  20. Public Function ReturnExtension(ByVal fileExtentsion As String) As String
  21. Select Case fileExtentsion
  22. Case ".html", ".htm"
  23. Return "text/HTML"
  24. Case ".txt"
  25. Return "text/plain"
  26. Case ".doc"
  27. Return "application/ms-word"
  28. Case ".tiff"
  29. Case ".tif"
  30. Return "image/tiff"
  31. Case ".asf"
  32. Return "video/x-ms-asf"
  33. Case ".avi"
  34. Return "video/avi"
  35. Case ".zip"
  36. Return "application/zip"
  37. Case ".xls"
  38. Case ".csv"
  39. Return "application/vnd.ms-excel"
  40. Case ".gif"
  41. Return "image/gif"
  42. Case ".jpg"
  43. Case "jpeg"
  44. Return "image/jpeg"
  45. Case ".bmp"
  46. Return "image/bmp"
  47. Case ".wav"
  48. Return "audio/wav"
  49. Case ".mp3"
  50. Return "audio/mpeg3"
  51. Case ".mpg"
  52. Case "mpeg"
  53. Return "video/mpeg"
  54. Case ".rtf"
  55. Return "application/rtf"
  56. Case ".asp"
  57. Return "text/asp"
  58. Case ".pdf"
  59. Return "application/pdf"
  60. Case ".fdf"
  61. Return "application/vnd.fdf"
  62. Case ".ppt"
  63. Return "application/mspowerpoint"
  64. Case ".dwg"
  65. Return "image/vnd.dwg"
  66. Case ".msg"
  67. Return "application/msoutlook"
  68. Case ".xml"
  69. Case ".sdxl"
  70. Return "application/xml"
  71. Case ".xdp"
  72. Return "application/vnd.adobe.xdp+xml"
  73. Case Else
  74. Return "application/octet-stream"
  75. End Select
  76.  
  77.  
  78. End Function
  79.  
Last edited by peter_budo; Sep 2nd, 2008 at 7:21 am. Reason: Keep It Organized - please use [code] tags
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ajit2mail is offline Offline
3 posts
since Jun 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP Forum Timeline: date() function
Next Thread in ASP Forum Timeline: Using INSERT, then DELETE from another table





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC