2.) All Office 2007 documents when retrieved open as corrupt.
Everything that I've found so far shows that Response.WriteBinary is
the right directrion. If it's not, I'm sure that there's someone out
there that can give me the right path to take.
> I have a small web app that publishes files to a SQL database. I just
> noticed this morning that 2 conditions exist that I need help with.
> 1.) Any file that can be open with NotePad have the HTML for the web
> page appended to the document when it's received. Example...
> This line was entered in the *.txt file prior to upload. Everything
> below this was added when retrieving from SQL.
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
> <html xmlns="http://www.w3.org/1999/xhtml">
> Untitled Page
> <link href="App_Themes/j
> End Example
> Upload Code:
> Download Code:
> 2.) All Office 2007 documents when retrieved open as corrupt.
> Everything that I've found so far shows that Response.WriteBinary is
> the right directrion. If it's not, I'm sure that there's someone out
> there that can give me the right path to take.
Remove all markup code from the aspx file, except the @Page directive.
Add the property Theme="" to the @Page directive, so that it doesn't try
to add theming to the page.
Alternatively, if you really want the page to either work as a web page
or a download proxy depending on some input, you can use Response.End()
after your code that is writing the file to the response stream to keep
the page from being rendeded to the stream also.