Hi All,
thanks for ur response.
Now i know how to upload the file(excel format) but i have problem download
the file and view it(excel format).
after i save the file/ try to view the file(excel format) from sqldatabase,
the file already corrupted.
Here is my code:
Function GetFile()
Dim PROD_CONNEC As SqlConnection = New
SqlConnection("Server=gl;uid=LBPCOS;pwd=new1;database=DB")
Dim PROD_CMD As SqlCommand = New SqlCommand("wla_getfile",
PROD_CONNEC)
Dim PROD_DR As SqlDataReader
PROD_CMD.CommandType = CommandType.StoredProcedure
Dim PRM_CP As New SqlParameter("@Attachment_ID", SqlDbType.Int)
PRM_CP.Value = CInt("1")
PROD_CMD.Parameters.Add(PRM_CP)
PROD_CONNEC.Open()
PROD_DR = PROD_CMD.ExecuteReader
If PROD_DR.Read Then
Response.ContentType = PROD_DR("Contenttype").ToString
Response.OutputStream.Write(CType(PROD_DR("Filedata"), Byte()),
0, CInt(PROD_DR("Filesize")))
Response.AddHeader("Content-Disposition", "attachment;filename="
+ PROD_DR("Filename").ToString())
Else
Response.Write("File Not Found.")
End If
PROD_CONNEC.Close()
End Function
Any ideas? I already out of ideas.
thank you.
best regards,
GL