![]() ![]() In this example the problem is I declare the Byte array arrBuffer with a size one byte too large. 'Use this method with as a parameter, for example.įileStream.Read(arrBuffer, 0, FileStream.Length) For me the issue was actually with the upload code not the download code: Public Sub ImportStream(FileStream As Stream) docx, so instead of putting the output file only in the response, I saved it first, and the file opened successfully, so I know the problem should be at response writing.įor what it's worth, I also ran into the same problem listed here. docx files, when downloaded, are corrupted and they need to be fixed by Office in order to be opened.Īt first I didn't know if the problem was at uncompressing the zip file that contained the. The problem is that all supported files works properly (jpg, gif, png, pdf, doc, etc), but. Response.BinaryWrite(stream.GetBuffer()) ![]() Response.AddHeader("Content-Disposition", "attachment filename=\"" filename "\"") ![]() ![]() Response.ContentType = "application/unknown" Throw new Exception("Resources_FileNotFound", ex) Using (ZipFile zip = ZipFile.Read(package)) I have this following code for bringing page attachments to the user: private void GetFile(string package, string filename) ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |