We need to save :-
Filename nvarchar(150),
FileData Image,
contentType nvarchar(max),
FileLength int
In database i am using SQL server 2008
now just use this mehod.
Protected Sub Download_File(ByVal fileName As String, ByVal contentType As String, ByVal fileData As Byte(), ByVal fileLength As Integer)
Try
Response.AddHeader("Content-Disposition", "attachment; filename=" + fileName.Replace(" ", "_").ToString)
Response.ContentType = contentType
Response.OutputStream.Write(fileData, 0, fileLength)
Response.End()
Response.Flush()
Catch ex As Exception
Throw ex
End Try
End Sub
This is also a good code to remember.
Filename nvarchar(150),
FileData Image,
contentType nvarchar(max),
FileLength int
In database i am using SQL server 2008
now just use this mehod.
Protected Sub Download_File(ByVal fileName As String, ByVal contentType As String, ByVal fileData As Byte(), ByVal fileLength As Integer)
Try
Response.AddHeader("Content-Disposition", "attachment; filename=" + fileName.Replace(" ", "_").ToString)
Response.ContentType = contentType
Response.OutputStream.Write(fileData, 0, fileLength)
Response.End()
Response.Flush()
Catch ex As Exception
Throw ex
End Try
End Sub
This is also a good code to remember.