Re: File downloading problem
You might need to use "type" variable you have declared and assigned. You need to assign it into Response.ContentType.
Then test it again.
If you still have problem, Just change your code to use Response.BinaryWrite() instead of Response.WriteFile().
Re: File downloading problem
Hi
Thanks for the reply.
The response.ContentType not working and also I know the filename with full path, I dont know how to use the BinaryWrite. Can you please help me how to use the binarywrite in my situation.
Thanks
Balakumar
Re: File downloading problem
hey man, You are the great. Thank you so much. Its working fine now.
I used the below code....
Dim MyFileStream As FileStream
Dim FileSize As Long
MyFileStream = New FileStream(path1, FileMode.Open)
FileSize = MyFileStream.Length
Dim Buffer(CInt(FileSize)) As Byte
MyFileStream.Read(Buffer, 0, CInt(FileSize))
MyFileStream.Close()
Response.BinaryWrite(Buffer)
Thanks
Balakumar
Re: File downloading problem
Code:
Dim MyFileStream As FileStream
Dim FileSize As Long
MyFileStream = New FileStream(fname, FileMode.Open)
FileSize = MyFileStream.Length
Dim Buffer(CInt(FileSize)) As Byte
MyFileStream.Read(Buffer, 0, CInt(FileSize))
MyFileStream.Close()
Response.BinaryWrite(Buffer)
I just copied and edited the sample code from msdn...
Re: File downloading problem
Thank you so much.
balakumar