473,513 Members | 10,313 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Download binary data from WebService

Any general ideas how to get binary data(files) from WebService to an
ASP .NET app and then save it to client's machine?

Thanks

Nov 21 '05 #1
4 1286
Nikolay,

You have first to serialize them.

A sample from Tom that I find nice

\\\Tom Shelton
Private Function SerializeFontObject(ByVal fnt As Font) As String
Dim bf As New BinaryFormatter
Dim mem As New MemoryStream
Try
bf.Serialize(mem, fnt)
Return Convert.ToBase64String(mem.ToArray())
Catch
Return String.Empty
Finally
mem.Close()
End Try
End Function
Private Function DeserializeFontObject(ByVal fnt As String) As Font
Dim bf As New BinaryFormatter
Dim mem As New MemoryStream(Convert.FromBase64String(fnt))
Try
Return DirectCast(bf.Deserialize(mem), Font)
Finally
If Not mem Is Nothing Then
mem.Close()
End If
End Try
End Function

I hope this helps a little bit?

Cor
Nov 21 '05 #2
I know I can also use DIME attachments, so I don't need to convert the
data to Base64.

my question was not very exact .

I am looking in to way of sending big files (over 10MB). The way of
using DIME attachements is good for this, because i can split the files
to parts, not send them as one piece. I've used the for upload and it
works great.

The problem is that I can't figure out how to ask the web service for
the first part, then second and so on.

when uploading to web service i do a FOR loop and send chunks if data
to service, which concantenates them in file, but how to make the
service reads parts of the file and send them is unclear to me.

the reason i want to split the transfered files to parts is that it
will consume a lot of memory at the server if I read the whole file,
serialize it and then start sending it.

Nov 21 '05 #3
Nikolay,

I thought I answered this question already like this, however when not.

Why don't you just download them with webclient downloadfile, where you get
the url from the webservice

I hope this helps?

Cor
Nov 21 '05 #4
this will also work i guess
tnx.

Nov 21 '05 #5

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

Similar topics

3
10821
by: Dux | last post by:
I have used some example code to create a database in MySQL and using php I can add binary files to the database. I was under the impression that I would be able to download the files with the...
1
6571
by: amy | last post by:
what is the method to send a binary file to a client from a webservice ? what is the method to receive/download this binary file and save it to the local machine in a client application ? THANKS!
5
1564
by: sc48567189 | last post by:
Hello ! I need some help here. I google after the response but with no sucess. I need to download - randon size - parts of a file, not the whole file. Says: I have the zip file test.zip, it is 10...
4
3647
by: Nikolay Petrov | last post by:
Any general ideas how to get binary data(files) from WebService to an ASP .NET app and then save it to client's machine? Thanks
1
2593
by: Julia Beresford | last post by:
Hi My application consists of a database, WebService and web application. The web application reads and writes data to the database via the WebService. I also want to be able to...
2
6927
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
2
1665
by: =?Utf-8?B?SHVzYW0=?= | last post by:
Hi EveryBody: I'm working with project in my company by using ASP.Net 2.0 that allow the users to upload and download files to web site in the internet as backup. The user will first upload his...
1
47355
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
0
7254
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
7153
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7373
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
7432
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
7519
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
5677
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,...
1
5079
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
796
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.