ASP.NET .aspx BinaryReader Stream File Download

Closed Posted Apr 12, 2004 Paid on delivery
Closed Paid on delivery

**Goal:**

Users need to download files off my web server, but I don't want to give them

the direct path to the file through IIS. I want to stream it to them through

ASP.NET.

**Methods Tried:**

[url removed, login to view]() - fails miserably. It is not scalable.

[url removed, login to view]() - client must hit IIS, and can d/l the file numerous times.

I need to stream it so I can limit the # of d/ls.

**Summary of work:**

I need one .aspx file that simply opens a file reads 32k, and writes it to the

HTTP stream. That's it. It must do that until its done reading the file and

streaming it to the user. It might be a dozen lines of code. Must be in C#.

**Usage:**

We will scale it to many individuals and it should be able to easily handle up

to 1GB files. Obviously most of the limitation will not be your code since ur

code is about one or two dozen lines.

**Time Required:**

The bid will be open for one day. The code should get back to me in 2 days max.

This is not hard work. Its pretty simple.

Here is an example of some code that pretty much does the job. But I need you to

just make sure it works with one ASPX file. I specify the path of the file, you

stream it. I'd prefer you set the ContentType, content disposition, and

content-length as below but it is not required.

(see deliverable section)

## Deliverables

1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.

2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables):

a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment.

b) For all others including desktop software or software the buyer intends to distribute: A software installation package that will install the software in ready-to-run condition on the platform(s) specified in this bid request.

3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement).

public void ProcessRequest (HttpContext context)

{

[url removed, login to view] = false;

if (_FilePath!=null)

{

[url removed, login to view]();

[url removed, login to view] = "application/octet-stream";

long Size = new [url removed, login to view](_FilePath).Length;

[url removed, login to view]("content-disposition", "attachment;

filename="+_FileName);

[url removed, login to view]("content-length",[url removed, login to view]());

[url removed, login to view] file = new [url removed, login to view](_FilePath,

[url removed, login to view],[url removed, login to view],[url removed, login to view],1024);

System.IO.**BinaryReader** b = new System.IO.**BinaryReader**(file);

byte[] bytes = new byte[1024];

int read;

while((read = [url removed, login to view](bytes, 0, [url removed, login to view])) != 0)

{

[url removed, login to view](bytes);

}

[url removed, login to view]();

[url removed, login to view]();

[url removed, login to view]();

[url removed, login to view]();

}

}

Ref: [[url removed, login to view]][1]

## Platform

Windows 2003 Server, IIS 6, one ASPX file. You can develop on WinXP, Win2K, Win2K3. We all know it'll work. Must be written in C#. One .aspx file, not an "application", etc.

.NET ASP C# Programming Engineering MySQL PHP Software Architecture Software Testing

Project ID: #3169191

About the project

7 proposals Remote project Active May 4, 2004

7 freelancers are bidding on average $25 for this job

sixthsensevw

See private message.

$34 USD in 1 day
(107 Reviews)
6.4
leonidm

See private message.

$42.5 USD in 1 day
(85 Reviews)
5.8
aliviu2003

See private message.

$17 USD in 1 day
(49 Reviews)
5.6
vladislavtt

See private message.

$12.75 USD in 1 day
(39 Reviews)
4.9
rizwanahmedvw

See private message.

$25.5 USD in 1 day
(12 Reviews)
2.6
dotnetmastervw

See private message.

$17 USD in 1 day
(5 Reviews)
1.9
wwwcitypuertocom

See private message.

$25.5 USD in 1 day
(0 Reviews)
0.0