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

Streaming large files over network

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 must be the only method that users
receive image files.

Essentially, the aspx file is an intermediate between client browser and a
network share.

I don't want to load all file in my web server memory as a byte[] array and
then stream it to the browser.

Is there any way (or streaming techniques) that I can stream large file
directly from storage to the browser?

Any help would be appreciated,

Alan
Nov 17 '05 #1
4 8154
Alan,

Over an ASPX page, you could open the file in a file stream and read
chunks of a file at a time and then write those chunks to the output stream.

Also, you might want to look into the Web Service Extensions and expose
a web service which will send this stuff back using MTOM. It will probably
suit your needs as well.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"A.M-SG" <al******@newsgroup.nospam> wrote in message
news:ui****************@TK2MSFTNGP12.phx.gbl...
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 must be the only method that
users receive image files.

Essentially, the aspx file is an intermediate between client browser and a
network share.

I don't want to load all file in my web server memory as a byte[] array
and then stream it to the browser.

Is there any way (or streaming techniques) that I can stream large file
directly from storage to the browser?

Any help would be appreciated,

Alan

Nov 17 '05 #2
> Also, you might want to look into the Web Service Extensions and expose
a web service which will send this stuff back using MTOM. It will
probably suit your needs as well.


Unfortunatly, MTOM is still not good for steaming. The client side still
can not stream and must load the whole msg in memory before writing it out.
It also internally converts the bytes to base64 to "normalize" the msg
(which I do not fully understand why). Any MTOM advantage is still lost on
me at this point.

--
William Stacey [MVP]

Nov 17 '05 #3
True, but the OP indicated that he was concerned about the memory
consumption on the server. He wanted to avoid loading the file as one large
byte array, and write to the stream.

While I agree that MTOM isn't good for streaming on the client side (as
a matter of fact, it is not good for streaming at all on the client side),
the WSE extensions might not load the whole payload at once, and then send
it down.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"William Stacey [MVP]" <wi************@gmail.com> wrote in message
news:Of**************@tk2msftngp13.phx.gbl...
Also, you might want to look into the Web Service Extensions and
expose a web service which will send this stuff back using MTOM. It will
probably suit your needs as well.


Unfortunatly, MTOM is still not good for steaming. The client side still
can not stream and must load the whole msg in memory before writing it
out.
It also internally converts the bytes to base64 to "normalize" the msg
(which I do not fully understand why). Any MTOM advantage is still lost
on me at this point.

--
William Stacey [MVP]

Nov 17 '05 #4
> True, but the OP indicated that he was concerned about the memory
consumption on the server. He wanted to avoid loading the file as one
large byte array, and write to the stream.


True, but your just moving the memory issue to client for very large files.
You could crash the client or make it swap like crazy. So a streaming
solution on both ends may be a better solution. 1-50MB may be ok for some
clients, but not others, so what number is too big for all clients?

--
William Stacey [MVP]

Nov 17 '05 #5

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

Similar topics

2
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...
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...
1
by: Vanga Sasidhar | last post by:
Hi All, I am developing a program in Visual Basic .NET 2002. There are some videos in AVI format. For the protection of these AVI files i encrypted my files with the use of DES algorithm in the...
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,...
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
4
by: Daniel Marious | last post by:
Hi, I'm looking for a .Net/COM component which would allow a .Net programmer with no streaming experience to be able to save online streams to local resources (files or to DB). I know that if...
5
by: pmakoi | last post by:
dear all this might be a piece of cake for some of you out there but it is causing me a lot of stress given the fact that there is not enogh documentation out there regarding this topic I am...
4
by: =?Utf-8?B?TWljaGFlbA==?= | last post by:
Hello, I need some help. I am trying to write my own web server for serving up large files on my own network. I am using FileStream, BinaryReader, TcpClient, and Sockets. I am trying to break...
1
by: michaelpyles | last post by:
IIS6 (x86) - Classic ASP application - I am downloading files via calls to BinaryWrite from a C++ COM component. The ASP DLL doesn't seem to do a good job limiting memory usage based on the...
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...
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...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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
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
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...

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.