Hi,
I'm currently having a problem with creating a text file.
My task is to upload any kind of file into oracle and download the file from oracle.
I stored the content of the file by using blob data, and I can upload a file into oracle.
However, the problem caused when I tried to download a text file.
When I open the text file, the content seems to be messed up.
There are html and javascript codes added up the end of the content.
Other types of files such as image, excel, doc file work properly.
Here is the code that I used for downloading a file.
if (type.Equals("jpg"))
{ Response.ContentType = "image/jpeg";
} else if (type.Equals("xls"))
{ Response.ContentType = "application/vnd.ms-excel";
} else if (type.Equals("txt"))
{ Response.ContentType = "Plain/Text";
} else
{Response.ContentType = "application/msword";
}
string NFileName = (string)dr["FILENAME"];
Response.AddHeader("content-disposition", "attachment;filename=" + NFileName);
Response.BinaryWrite((byte[])dr["FILEDATA"]);
Can anyone help me with this problem?
I would appreciate that if anyone replies this subject.