473,386 Members | 1,958 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,386 software developers and data experts.

streaming random filetypes from .aspx

streaming random filetypes from .aspx

how to stream a file from inside a .aspx? e.g. so one could go
href="./foo.aspx?file=bar.mp3" or href="./foo.aspx?foo.dat" etc. preferabley
i would like all file types to open with "save as" when href clicked
Oct 20 '05 #1
1 1800
Daniel wrote:
streaming random filetypes from .aspx

how to stream a file from inside a .aspx? e.g. so one could go
href="./foo.aspx?file=bar.mp3" or href="./foo.aspx?foo.dat" etc.
preferabley i would like all file types to open with "save as" when
href clicked


Try this:

Private Sub Page_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
Response.Clear()
Response.ContentType = "application/octet-stream"
Response.AddHeader("Content-type", "application/octet-stream")
Response.AddHeader("Content-Disposition", "attachment;
filename=""bar.mp3""")
Response.Write(contentsOfBinaryFile)
Response.End()
End Sub

Oct 21 '05 #2

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

Similar topics

1
by: Jakob Bengtsson | last post by:
Hi, Does anyone know how to get the icons for all filetypes installed on the system? I can extract the associated icon from a file, but I don't know how to: 1) Get a list of filetypes; 2) Get...
1
by: Justin Straube | last post by:
Hopefully someone can catch what im missing here. Ive googled this and I think Ive got the filetypes arg written properly, but I get a traceback when calling this function. Heres the code...
1
by: Daniel | last post by:
streaming random filetypes from .aspx how to stream a file from inside a .aspx? e.g. so one could go href="./foo.aspx?file=bar.mp3" or href="./foo.aspx?foo.dat" etc. preferabley i would like...
5
by: Eric Sabine | last post by:
I have a web site where the user is able to download a file. I can't use an anchor tag because I don't want the user to see where the filename is coming from. Below is the code in which the user...
3
by: A.M-SG | last post by:
Hi, I have a ASP.NET aspx file that needs to pass large images from a network storage to client browser. The requirement is that users cannot have access to the network share. The aspx file...
6
by: | last post by:
Hi all, is there a better way to stream binary data stored in a table in sql 2005 to a browser in .net 2.0? Or is the code same as in .net 1.1? We noticed that in certain heavy load scenarios,...
1
by: DB | last post by:
Hi All, I’m trying to stream a PDF with .NET 2.0 in a c# web app. However, it does not actually show the PDF (using adobe acrobat). The Situation: Click on a Button, Opens a new Window,...
4
by: tshad | last post by:
I am trying to set up an Image authorization where you type in the value that is in a picture to log on to our site. I found a program that is supposed to do it, but it doesn't seem to work. ...
3
by: Brad | last post by:
I have an aspx page that is sending pdf files to client browsers: it uses a filestream to read the pdf file and response.binarywrite to send content to the browser. This has worked great for years...
2
by: Bubbs | last post by:
hi, Lemme give u a little background on my problem. Ive created a client and server applications that receive and stream live time values. The client software is a clock that receives the time and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...

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.