473,395 Members | 1,403 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,395 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 1802
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.