c# - ppt and pptx files are corrupted when trying to stream from asp.net website -
i trying stream documents server location asp.net website. document types work expected apart powerpoint ppt , pptx files. when these streamed message "powerpoint found problem content in [filename]" if selected save rather open open doc works ok.
my code follows
wcf service
//get doc server , convert bytearray filestream myfilestream = new filestream(fullpath, filemode.open, fileaccess.read, fileshare.read); byte[] myfilebyte = new byte[(int)myfilestream.length]; myfilestream.read(myfilebyte, 0, (int)myfilestream.length); myfilestream.close();
asp.net web app
response.addheader("content-disposition", "attachment; filename=" + filename); response.buffer = true; response.bufferoutput = true; response.binarywrite(getdoc.downloaddata); // [byte array ] response.end();
i have tried using response.flush stops opening. ideas has stumped me few days now. thanks
further update. unticking trust options within installation of powerpoint on machine files open correctly.
this isn't ideal i'll have add section website inform company user base have work around.
surely there must way in code??
Comments
Post a Comment