473,761 Members | 2,440 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Allow browser streaming of multimedia files

Hello,

I'm looking for a way to allow a client who clicks on a link the ability to
"adodb.stre am" a multimedia file (mainly audio/wav) files, but the file they
would be accessing is outside the wwwroot (for security / traceability). I
don't want the "save as" box to open for streamable content. Basically I'm
trying to mimic the exact action, as if they had clicked a
www.mydomain.com/download.wav file, and allow the browser to open it up
automatically and save it if needed.

Here is the code I'm currently using to stream the audio file to the client.

Set objStream = Server.CreateOb ject("ADODB.Str eam")
objStream.Open
objStream.Type = adTypeBinary
objStream.LoadF romFile "c:\outside_my_ wwwroot\test.wa v"
Response.Conten tType = "audio/wav"
Response.Binary Write objStream.Read( )
objStream.Close

I'm sure it can be done, I really just probably need the appropriate headers
to tag to page (I'm using the adodb.stream object ).

Can anyone help me out with this?

Thanks!
--Michael
Jul 19 '05 #1
1 3511
I've figured it out, for those ever interested, you need to do this.

Response.AddHea der "Content-Disposition", "inline; filename=anyfil ename.wav"

key is in the "inline" not "attachment ", If you want to force a "save as"
box, you just have to use attachment. You'll also need to set up the
ContentType, as so

strFileType = lcase(Right(str FileName, 4))

Select Case strFileType
Case ".asf"
ContentType = "video/x-ms-asf"
Case ".avi"
ContentType = "video/avi"
Case ".doc"
ContentType = "applicatio n/msword"
Case ".zip"
ContentType = "applicatio n/zip"
Case ".xls"
ContentType = "applicatio n/vnd.ms-excel"
Case ".gif"
ContentType = "image/gif"
Case ".jpg", "jpeg"
ContentType = "image/jpeg"
Case ".wav"
ContentType = "audio/wav"
Case ".mp3"
ContentType = "audio/mpeg3"
Case ".mpg", "mpeg"
ContentType = "video/mpeg"
Case ".pdf"
ContentType = "applicatio n/pdf"
Case ".rtf"
ContentType = "applicatio n/rtf"
Case ".htm", "html"
ContentType = "text/html"
Case ".asp"
ContentType = "text/asp"
Case Else
'Handle All Other Files
ContentType = "applicatio n/octet-stream"
End Select

Response.Conten tType = ContentType

"Michael" <raterus@localh ost> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
Hello,

I'm looking for a way to allow a client who clicks on a link the ability to "adodb.stre am" a multimedia file (mainly audio/wav) files, but the file they would be accessing is outside the wwwroot (for security / traceability). I don't want the "save as" box to open for streamable content. Basically I'm trying to mimic the exact action, as if they had clicked a
www.mydomain.com/download.wav file, and allow the browser to open it up
automatically and save it if needed.

Here is the code I'm currently using to stream the audio file to the client.
Set objStream = Server.CreateOb ject("ADODB.Str eam")
objStream.Open
objStream.Type = adTypeBinary
objStream.LoadF romFile "c:\outside_my_ wwwroot\test.wa v"
Response.Conten tType = "audio/wav"
Response.Binary Write objStream.Read( )
objStream.Close

I'm sure it can be done, I really just probably need the appropriate headers to tag to page (I'm using the adodb.stream object ).

Can anyone help me out with this?

Thanks!
--Michael

Jul 19 '05 #2

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

Similar topics

2
18906
by: Average_Joe | last post by:
Hello Java people, Been awhile since I've used Java, and when I did, it was pretty much XML stuff. Anyhow, I've got a client who needs to provide web viewers with both streaming (live) video as well as earlier recorded stuff. There are solutions for this, but they all seem to involve using a windows platform for performing conversion(s). (Either the cameras and
1
2160
by: JC | last post by:
Hi, I have to play a streaming audio. So in a thread I play audio as follow thread{ //some code for(;;){ //some code waveOutPrepareHeader(hwo, &(whdr), sizeof(WAVEHDR)); waveOutWrite(hwo, &(whdr), sizeof(WAVEHDR));
3
6217
by: Rob | last post by:
I have an ASP.Net web app that generates a Crystal Report in PDF format. Since there is sensitive data within the reports, the pdfs need to be streamed to the browser then deleted immediately. The report gets kick off by a Java application redirecting the URL to the ASP.Net app on the IIS Server with all report selection criteria appended to the querystring. The Crystal Report is rendered in a new window. In the Page_Load() event, I...
1
1404
by: adiela | last post by:
hello everyone..i would like to ask something regarding my project.. i've been planning to develop a website using asp code for streaming multimedia features...unfortunatly...i have zero knowledge bout all this things that needed...can someone give me a rough guideline bout what should i do step-by-step... such as..what database should i use...how can i store or create a database that can hold my multimedia files? i really do need ur...
4
3894
by: Gary Brown | last post by:
Hi, I need a web browser capable of handling video streams and that will stay in front of the Z order. There are a number of video streaming sources I watch that launch a browser window containing the video from another browser page. I am almost always working on something else while following the video. Consequently the video disappears behind the application window I'm using. I've tried staggering my windows to avoid this but even...
2
1991
by: Changhao | last post by:
Hi, friends, I am implementing a protocol on top of 'asyncore.dispatcher' to send streaming multimedia data over TCP socket. However, I found that the throughput of my current implementation is surprisingly low. Below is a snippet of my code with a note that: the packet sent over the socket is of variable length, of which the first a couple bytes indicates the length of the packet. I implemented a 'var_str_to_int' function to get the...
0
1464
by: namrataa | last post by:
Hi, I am doing a client-server based multimedia player in VS2008 using WCF & WPF C#. I have used mediaelement for the player. Now my problem is that when a user selects a particular song to the server, the server should stream the song, and at the client it should start playing as though the song is played from the local disk. I tried changing the "transfer mode =streamed" in client but still no solution. Please help me out.
2
448
by: Alberto corrales | last post by:
Hi! I am working with a video source that provides RGB frames (24 bits per pixel) and I need to create a video server to send on wifi to a client application. The problem is that there are too much data and I need to compress video in real time and send it compressed. You have any idea how they can do this to send streaming compression? Are there any libraries or source code to facilitate this task?
2
1412
pradeepjain
by: pradeepjain | last post by:
i have a small doubt i dont know if ques is proper or not sorry. I have got a call for job for this company http://www.telecascade.com/ Thye told job will be related to multimedia and video streaming and stuff.Can any one tell how php will be used in those things .Hope website can help to tell in detail.
0
9522
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9336
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10111
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9948
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7327
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6603
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3866
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3446
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2738
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.