A
andchoi
I am wondering whether this is the best way to do this. Would love to
hear what people think.
Here is the scenario:
I have this ASP.NET 2.0 page which allows user to enter some parameters
and then it dynamically generates a WAV or WMV file, depending on
preference. I want to send this back to the user via an <OBJECT> tag.
The way I am doing this right now is to assign the byte[] array to the
Session. Then, I generate an <OBJECT> tag (via an ASP literal control
added to a PlaceHolder control on the page) with the name being another
ASP Page (let's say MediaPlay.aspx).
In the Page load method of MediaPlay.aspx, I do something like this
(skip the error checking for clarity):
byte[] buffer = Session["MediaFile"];
Response.ContentType = Session["MediaContentType"];
Response.BinaryWrite(buffer);
Response.Flush();
Response.Close();
It seems to work, but I am wondering whether there is a better way to
do this. What do you think?
hear what people think.
Here is the scenario:
I have this ASP.NET 2.0 page which allows user to enter some parameters
and then it dynamically generates a WAV or WMV file, depending on
preference. I want to send this back to the user via an <OBJECT> tag.
The way I am doing this right now is to assign the byte[] array to the
Session. Then, I generate an <OBJECT> tag (via an ASP literal control
added to a PlaceHolder control on the page) with the name being another
ASP Page (let's say MediaPlay.aspx).
In the Page load method of MediaPlay.aspx, I do something like this
(skip the error checking for clarity):
byte[] buffer = Session["MediaFile"];
Response.ContentType = Session["MediaContentType"];
Response.BinaryWrite(buffer);
Response.Flush();
Response.Close();
It seems to work, but I am wondering whether there is a better way to
do this. What do you think?