I have an AJAX file uploader on my page, and use this to store various different file types into a database, However when I store a .rtf file and then try to output this using response, I get a file corrupt and cannot be opened error message. The file uploader automatically detects the mime type of the file on upload and stores the file as "application/msword" as this didn't work I tried giving it several other mime types however none of them worked.
Does anyone know of any reasons why this file may be corrupt?
PS. I have also tried uploading several different .rtf files with text, no text and images, etc. however none of them worked. output code below:
context.Response.Clear();
context.Response.ClearHeaders();
context.Response.ClearContent();
context.Response.ContentType = displayFile.MimeType;
context.Response.AddHeader("content-disposition", "attachment; filename=" + displayFile.FileName);
context.Response.BinaryWrite(displayFile.Data);
context.Response.End();