File Download Dialog Box(ASP)

Reply

Join Date: Jan 2006
Posts: 2
Reputation: elblazzy4chizzy is an unknown quantity at this point 
Solved Threads: 0
elblazzy4chizzy elblazzy4chizzy is offline Offline
Newbie Poster

File Download Dialog Box(ASP)

 
0
  #1
Jan 25th, 2006
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:
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 167
Reputation: Drew is an unknown quantity at this point 
Solved Threads: 7
Drew's Avatar
Drew Drew is offline Offline
Junior Poster

Re: File Download Dialog Box(ASP)

 
0
  #2
Jan 25th, 2006
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.
Drew Gauderman
ASP / MSSQL Coder
http://www.iportalx.net - My ASP Portal
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 2
Reputation: CrunchyFrog is an unknown quantity at this point 
Solved Threads: 0
CrunchyFrog CrunchyFrog is offline Offline
Newbie Poster

Re: File Download Dialog Box(ASP)

 
0
  #3
May 8th, 2006
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);
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 2
Reputation: CrunchyFrog is an unknown quantity at this point 
Solved Threads: 0
CrunchyFrog CrunchyFrog is offline Offline
Newbie Poster

Re: File Download Dialog Box(ASP)

 
0
  #4
May 9th, 2006
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.
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 1
Reputation: sakshi006 is an unknown quantity at this point 
Solved Threads: 0
sakshi006 sakshi006 is offline Offline
Newbie Poster

Re: File Download Dialog Box(ASP)

 
0
  #5
May 23rd, 2006
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.
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 1
Reputation: BraidedRainbows is an unknown quantity at this point 
Solved Threads: 0
BraidedRainbows BraidedRainbows is offline Offline
Newbie Poster

Re: File Download Dialog Box(ASP)

 
0
  #6
Apr 27th, 2008
Hi there,
I too am looking for the codes of the download dialog box. Did you get a reply or and answer?
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 3
Reputation: hiralmehta is an unknown quantity at this point 
Solved Threads: 0
hiralmehta hiralmehta is offline Offline
Newbie Poster

Re: File Download Dialog Box(ASP)

 
0
  #7
May 26th, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 2
Reputation: dreemebird is an unknown quantity at this point 
Solved Threads: 0
dreemebird dreemebird is offline Offline
Newbie Poster

download link in my webpage

 
0
  #8
Aug 24th, 2008
how i can put download link for image,flash file,other file in my webpage that can other download it ?
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 2
Reputation: dreemebird is an unknown quantity at this point 
Solved Threads: 0
dreemebird dreemebird is offline Offline
Newbie Poster

Re: File Download Dialog Box(ASP)

 
0
  #9
Aug 24th, 2008
how i can put download link for image,flash file,other file in my webpage that can other download it ?
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 3
Reputation: ajit2mail is an unknown quantity at this point 
Solved Threads: 0
ajit2mail ajit2mail is offline Offline
Newbie Poster

Re: File Download Dialog Box(ASP)

 
0
  #10
Aug 26th, 2008
Try
  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
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for ASP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC