| | |
While I am Downloading ,One Dialogbox will open.When user will be saving file name...
Please support our ASP.NET advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Aug 2007
Posts: 3
Reputation:
Solved Threads: 0
While I am Downloading ,One Dialogbox will open.When user will be saving file name...
0
#1 Sep 6th, 2007
While I am Downloading ,One Dialogbox will open.When user will be saving file name...that time I want to restrict user to change the file name ..I have written code below for downloading file.
Dim fs As System.IO.FileStream = Nothing
fs = File.Open(Server.MapPath("TextFiles/Branch/" + filenam + ".txt"), System.IO.FileMode.Open)
Dim btFile(fs.Length) As Byte
fs.Read(btFile, 0, fs.Length)
fs.Close()
With Response
.AddHeader("Content-disposition", "attachment;filename=" & filenam)
.ContentType = "application/octet-stream"
.BinaryWrite(btFile)
.End()
End With
With Regards,
mishrap
Dim fs As System.IO.FileStream = Nothing
fs = File.Open(Server.MapPath("TextFiles/Branch/" + filenam + ".txt"), System.IO.FileMode.Open)
Dim btFile(fs.Length) As Byte
fs.Read(btFile, 0, fs.Length)
fs.Close()
With Response
.AddHeader("Content-disposition", "attachment;filename=" & filenam)
.ContentType = "application/octet-stream"
.BinaryWrite(btFile)
.End()
End With
With Regards,
mishrap
![]() |
Similar Threads
- could not open INSTALL.LOG file. (Windows NT / 2000 / XP)
- could not open install log file (Windows NT / 2000 / XP)
- Unable to open Web Project '...'. The file path '...' does not correspond to the URL (ASP.NET)
- Unable to open Web Project '...'. The file path '...' does not correspond to the URL (Community Introductions)
- Saving a file using C++ (C++)
Other Threads in the ASP.NET Forum
- Previous Thread: I want to create text file on clients local drive.Please help.
- Next Thread: ASPX files not loading
Views: 643 | Replies: 0
| Thread Tools | Search this Thread |
Tag cloud for ASP.NET
.net 2.0 ajax alltypeofvideos appliances application asp asp.net beginner box browser button c# cac checkbox class complex connection control countryselector dataaccesslayer database datagridview datalist deployment development dgv dialog dropdownlist dynamic dynamically edit editing embeddingactivexcontrol feedback fileuploader fill findcontrol flash form gridview gudi iis image javascript languages list listbox login maps microsoft mobile mouse mssql news novell numerical opera panelmasterpagebuttoncontrols parent problem profile project radio redirect registration relationaldatabases reportemail response.redirect richtextbox rows schoolproject search security select services sessionvariables silverlight smoobjects software sql sql-server ssl theft tracking treeview validatedate validation vb.net videos vista visualstudio vs2008 web webapplications webdevelopment webprogramming webservice wizard xsl





