Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > streaming an object to the browser

Reply
Thread Tools

streaming an object to the browser

 
 
=?Utf-8?B?a2FwaWxw?=
Guest
Posts: n/a
 
      03-29-2006
hi,

i am doing a proof of concept and trying to stream 2 objects to the browser
one is a pdf and another is a .3g2 video file. when i try to do the pdf it
works great and the pdf opens in the browser but when i do the video file it
just returns the gibrish from the byte[]. the vodeo is fine because when i
link to the video directly then quicktime opens in the browser and it starts
to play.

I checked anyway and the 3g2 extension is on the machine and associated with
quicktime.

i just cant understand why the browser dosent start the video then i stream
it. any ideas????

check out the code.

FileStream fs = new FileStream(@"c:\website1\test.3g2", FileMode.Open);
//FileStream fs = new FileStream(@"c:\website1\test.pdf", FileMode.Open);
byte[] b = new byte[fs.Length];
fs.Read(b, 0, (int)fs.Length);
fs.Close();
fs.Dispose();
Response.ContentType = "video/3g2";
//Response.ContentType = "text/pdf";
Response.BinaryWrite(b);
 
Reply With Quote
 
 
 
 
slagomite
Guest
Posts: n/a
 
      03-29-2006
did you try any of these content types?

video/3gpp
video/3gpp-tt
video/3gpp2

or maybe

video/quicktime

HTH
Luke

 
Reply With Quote
 
 
 
 
=?Utf-8?B?a2FwaWxw?=
Guest
Posts: n/a
 
      03-29-2006
I have tried all except video/quicktime. Just tried that and it also returns
gibrish. Any other ideas?
 
Reply With Quote
 
=?Utf-8?B?a2FwaWxw?=
Guest
Posts: n/a
 
      03-29-2006
in addition i tried to do this with a .mov(video/quicktime) file and a
..wmv(video/x-ms-wmv) file. i get the same gibrish.

agian it works when you link to the file for video but the streaming works
for a pdf.

if it works for the pdf, why not the video, its the same concept.

does this mean you can stream certian objects in .net???
 
Reply With Quote
 
=?Utf-8?B?a2FwaWxw?=
Guest
Posts: n/a
 
      03-29-2006
GOT IT!

had to add
Response.Flush();

after
Response.BinaryWrite(b);

just incase anyone encounters this.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Object creation - Do we really need to create a parent for a derieved object - can't the base object just point to an already created base object jon wayne C++ 9 09-22-2005 02:06 AM
Streaming Word to browser on SSL supresses header and footer =?Utf-8?B?UnVkeSBEZWl0cmljaw==?= ASP .Net 0 12-02-2004 05:09 PM
Re: Streaming PDF to Browser from Server Jerry Boone ASP .Net 0 01-09-2004 02:23 PM
Re: Streaming PDF to Browser from Server Hans Kesting ASP .Net 0 01-09-2004 09:38 AM



Advertisments