First of all, thanks to everyone who commented and emailed with ideas for me. I found WriteFile within a few minutes of my first blog post Friday, and it worked sweetly on my machine.
string filePath = "c:\\documents and settings\\sreynolds\\my documents\\whitepapers - PDF\\dalg.pdf";
//Response.Write("fucking fuck");
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = "Application/pdf";
Response.AddHeader("Content-Disposition","inline;" + filePath);
Response.WriteFile(filePath);
Response.Flush();
Response.End();
So yeah (left the comment in there so you could see my mind state). Anyway, it worked fine on my machine, not at all on another developer’s machine. And not at all in IE. IE kept prompting for save (I tried the Content-Disposition thing with both the file path and just file name since I wasn’t sure).
After trolling newsgroups, listening to you guys, and googling for freaking ever, I see that there doesn’t seem to be another way to do WriteFile, and that this implementation just straight-up hates me and my team.
I haven’t tried the BinaryWrite yet on another machine, and in the interim we are using a file.copy() on demand to the web server and the redirecting it, which is cheesey as hell, but works for the demo.