473,322 Members | 1,188 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Server storing dynamically generated media files

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?

--
AC

Nov 23 '05 #1
1 932
probably not the best.

1) if you use inproc sessions, a large number of users may cause a recycle.
2) even if you use out of proc sessions, the wave file must be loaded on
every page hit after one is loaded.
3) if you clear the wave file from memory after download, a page referesh
will fail

you should store then in a temp storage (sql or disk), and run a cleanup job
that purges after session close.

-- bruce (sqlwork.com)

<an*****@gmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
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?

--
AC

Nov 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Manuel Alves | last post by:
Hi, Is it possible to store media files (like windows .wmv) on SQL Server 2005 and stream it back to the client via media server (not just download it)? Regards, Manuel Alves
2
by: Sandman | last post by:
Ok, so I'm the author of a pretty big CMS system (big as in huge, not market-share big) and I've been thinking about a problem for a few weeks here on media management. The CMS accomodates both...
46
by: RAZZ | last post by:
Hello, Can anyone suggest me solution? I Need to manage different types of documents (doc,xls,ppt etc) in server. I have folder structure to maintain these documents in server. Say folder1 is...
46
by: RAZZ | last post by:
Hello, Can anyone suggest me solution? I Need to manage different types of documents (doc,xls,ppt etc) in server. I have folder structure to maintain these documents in server. Say folder1 is...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.