473,396 Members | 2,140 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,396 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 4591
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.