472,959 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,959 software developers and data experts.

Transport large binary file from Window client application to Web Server & back

Hi All
I need some help for the below problem:

Scenario

We need to send large binary files (audio file of about 10 MB or so)
from the client machine (.Net Windows based application, located
outside the home network) to the Web Server and then retrieve the file
back from the web server to the client.

Possible Solutions

1. Sending the entire file using https

2. Sending the file using XOP (XML binary optimized packaging), but the
limitation with this approach is that the actual binary data is stored
in XOP package which is stored on a external Web Server and the XOP
(XML) document just contains a reference of the actual binary file.

3. Sending the file using SFTP( limitation client as some issues
regarding storing password information for SFTP and is not the
preferred option)

4. Using DIME - Sending Binary Data with SOAP Messages

5. Using WS-Attachments

6. Using https - not sure if large files can be handled efficiently

In a normal scenario, the binary file can be converted into XML by
using binary64 encoding. But due to large nature of the size of the
file, there may be performance issues.

I will appreciate if you can provide me some useful inputs on how to
resolve the above problem either through any of the above mentioned
solutions or some new possibility which I have not explored yet.

Regards

Gaurav

Nov 23 '05 #1
2 4536
http://msdn.microsoft.com/webservice...ml/newwse3.asp

MTOM, otherwise known as Message Transmission Optimization Mechanism,
enables you to send binary data efficiently as part of a SOAP message. The
key word here is optimization, since to all intents and purpose this is
transparent to the developer and simply just happens when enabled. MTOM is a
W3C recommendation that replaces DIME and WS-Attachments as the mechanism
for sending large amounts of data such as document files and images.
<ga**********@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
We need to send large binary files (audio file of about 10 MB or so)
from the client machine (.Net Windows based application, located
outside the home network) to the Web Server and then retrieve the file
back from the web server to the client.

Nov 23 '05 #2
Hi,
Its quite easy to send large files as DIME attachments with WSE2. I use
#ziplib to zip the files i send if they are above a certain size (but i guess
if they are mp3s/compressed this wouldnt be needed)

easy as

using(MyWebService.TransferServicesWse service = new
MyWebService.TransferServicesWse())
{
DimeAttachment attachment = new DimeAttachment("a_music_file,
"audio/compressed", TypeFormat.None, "c:\music\a.mp3");
service.RequestSoapContext.Attachments.Add(attachm ent);
service.UploadFiles();
}
and in the webservice

for (int index = 0; index < requestContext.Attachments.Count; index++)
{
string fileName = requestContext.Attachments[index].Id;

using(Stream stream = requestContext.Attachments[index].Stream)
{
switch(requestContext.Attachments[index].ContentType)
{
case "audio/compressed":
{
//if its big take it in chunks (im too lazy to put it in this example)
byte[] buffer = new byte[stream.Length];
stream.Read(buffer, 0, buffer.Length);
using(FileStream fstream = File.Create(@"c:\temp\" + fileName,
buffer.Length))
{
fstream.Write(buffer, 0, buffer.Length);
fstream.Close();
}
break;
}

}

stream.Close();
}
}

hope that helps you :)

Scott

"ga**********@gmail.com" wrote:
Hi All
I need some help for the below problem:

Scenario

We need to send large binary files (audio file of about 10 MB or so)
from the client machine (.Net Windows based application, located
outside the home network) to the Web Server and then retrieve the file
back from the web server to the client.

Possible Solutions

1. Sending the entire file using https

2. Sending the file using XOP (XML binary optimized packaging), but the
limitation with this approach is that the actual binary data is stored
in XOP package which is stored on a external Web Server and the XOP
(XML) document just contains a reference of the actual binary file.

3. Sending the file using SFTP( limitation client as some issues
regarding storing password information for SFTP and is not the
preferred option)

4. Using DIME - Sending Binary Data with SOAP Messages

5. Using WS-Attachments

6. Using https - not sure if large files can be handled efficiently

In a normal scenario, the binary file can be converted into XML by
using binary64 encoding. But due to large nature of the size of the
file, there may be performance issues.

I will appreciate if you can provide me some useful inputs on how to
resolve the above problem either through any of the above mentioned
solutions or some new possibility which I have not explored yet.

Regards

Gaurav

Nov 25 '05 #3

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

Similar topics

1
by: Russ Reynolds | last post by:
Problem: I'm writing a client app. that needs to download an image file (non-text) from a remote location and save to the client machine. Here is what I have so far (pseudocode): import...
4
by: Mike Dole | last post by:
I'm working on a client - server application based on the 'How to Sockets Server and How to Sockets Client' code from the Visual Basic ..NET Resource Kit. Since I want to be able to send 'big...
2
by: Lisa Pearlson | last post by:
Hi, My php application (on Apache/Linux) needs to do the following: The PHP script receives a request from a client (binary), asking for certain records of data. My PHP script loops through...
11
by: CSN | last post by:
Is it possible to iterate over an array in plpgsql? Something like: function insert_stuff (rel_ids int) .... foreach rel_ids as id insert into table (rel_id, val) values (id, 5);
0
by: gauravkhanna | last post by:
Hi All I need some help for the below problem: Scenario We need to send large binary files (audio file of about 10 MB or so) from the client machine (.Net Windows based application, located...
15
by: Nathan | last post by:
I have an aspx page with a data grid, some textboxes, and an update button. This page also has one html input element with type=file (not inside the data grid and runat=server). The update...
1
by: google | last post by:
I have created a simple HelloWorld application in WSE2.0 SP3. When I browse to the endpoint url over http (e.g. http://localhost/TestService.ashx) the WSDL is fine and I can create a client...
20
by: mike | last post by:
I help manage a large web site, one that has over 600 html pages... It's a reference site for ham radio folks and as an example, one page indexes over 1.8 gb of on-line PDF documents. The site...
0
by: Buddy Home | last post by:
Hello, I'm trying to upload a file programatically and occasionally I get the following error message. Unable to write data to the transport connection: An established connection was aborted...
3
by: Buddy Home | last post by:
Hello, I'm trying to upload a file programatically and occasionally I get the following error message. Unable to write data to the transport connection: An established connection was aborted...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...

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.