473,327 Members | 2,094 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,327 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 4580
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.