[thelist] (asp.net) Serving multiple binaries

Tab Alleman talleman at Lumpsum.com
Fri May 11 15:17:00 CDT 2007


I'm working on an intranet application (asp.net 2.0) that needs to assemble .rtf files and serve them in binary format to the user's browser.  

I can serve a single file with no problem, but what is also desired is to serve multiple files at once (from a single user-action like a click), such that multiple dialog boxes ("Do you want to open or save this file...?") pop up on the user's screen, eventually leading to multiple instances of word processors, each holding one of the requested documents.

I've got my server-side loop going and getting the docs, but I can't figure out how to serve them to the browser.  I've tried two approaches.  Neither works.  

Server-side:  
Do While ...
	Response.BinaryWrite(bytMyDoc)
	Response.Flush()
Loop
Response.End

and Client-Side (this is psuedo code)

Do While ...
	foo=window.open(blah)
	foo.document.open('application/rtf')
	foo.document.write(bytMyDoc)
	foo.document.close()		
Loop
Response.End


---

Any suggestions?  Can it even be done at all?



More information about the thelist mailing list