Sorry, yes, an ASP.Net web page. Im am OK with sending the stream to the response object once ive got it...my problem is actually getting the stream object from the middletier in the first place. PresLayer - Requests doc id 1 AppLayer - Receives Request - Obtains the path of the file from the db - can open the file (filestream?) - RETURNS THE FILE/STREAM PresLayer - Spits stream out to response object. My question is how i can pass the binary data back from the applayer to the preslayer. Eg, surely if i pass the filestream back (as an out parameter for example), the minute i call .Read on the front end, ill get an exception because the file actually exists on another machine ?!
roy_huntley
Posts
-
Passing a binary file(stream) to the presentation layer -
Passing a binary file(stream) to the presentation layerHi. I have a requirement to store files (they happen to be .pdf files but could be word/excel etc) on an application server. These files are to be requested from the presentation layer. When the user clicks a report, a reportid is passed to the middle tier, whereby it retrieves the associated filepath from the DB and then goes and loads the file. My problem is that I am not sure how to pass this file back to the presentation layer. What I would like to do, is spit out a stream to the response object so the file just opens in the users browser (rather than saving a copy on the web server and then allowing the user to either Open/Save). I thought a filestream or binaryreader object would do the trick, but if i pass this to the presentation layer, the second i call the .Read methods, ill get an exception as the file doesnt exist on the web server ! Can anybody suggest the best way(s) of achieving my goals ? Thanks.
-
C# and Window Message HooksHi. Im trying to find a way to hookup to the Window Created, Window Destroyed and Window Activated messages from my C# windows app. NB, id like to hook up to these messages from a system-wide scope and not just my own application (for example, id like to know whenever an internet explorer window is opened or made active. Is this possible ? Ive managed to hookup to the mouse_ll and keyboard_ll events, but no more ! Can anybody tell me if its possible ? and/or provide an example ? THanks.~ Roy.