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 4 3650
Nikolay,
You have first to serialize them.
A sample from Tom that I find nice
\\\Tom Shelton
Private Function SerializeFontOb ject(ByVal fnt As Font) As String
Dim bf As New BinaryFormatter
Dim mem As New MemoryStream
Try
bf.Serialize(me m, fnt)
Return Convert.ToBase6 4String(mem.ToA rray())
Catch
Return String.Empty
Finally
mem.Close()
End Try
End Function
Private Function DeserializeFont Object(ByVal fnt As String) As Font
Dim bf As New BinaryFormatter
Dim mem As New MemoryStream(Co nvert.FromBase6 4String(fnt))
Try
Return DirectCast(bf.D eserialize(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
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.
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
this will also work i guess
tnx. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 source code
provided, but am having trouble doing that.
<?php
if ($id_files) {
include "./include/open_db.inc";
$sql = "SELECT bin_data, filetype, filename, filesize FROM tbl_Files
WHERE id_files=$id_files";
|
by: Brandon Walters |
last post by:
I wrote a file download module for my website. The reason for the file
download module is that my website downloads work on a credit based system.
So I need to keep track of and limit daily downloads.
It uses fpassthru() and some headers() to send a file to the requesting
user. The get.php file that I wrote (the file download module if you will)
works like a charm for .ZIP files and .TXT files. However, when .EXE files
are downloaded...
|
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!
|
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
|
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 mega bytes long. But I
don't want the 10 mega today. Today I want 5 mega bytes. Tomorrow I
could want more 3 mega bytes of the file, but it is not sure, could be
4 mega bytes. I need to part the zip file in chunks at request. No CGI,
no asp, no...
| |
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 upload/download files via the WebService because my
WebService handles security.
My question is - how can this best be done? After some googleing a solution
I found was to stream bytes in a method like this:
|
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
attending interviews. If you own a company best way to judge if the
candidate is worth of it.
http://www.questpond.com/InterviewRatingSheet.zip
|
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 or her own files in the website that will save the
data immediatlly into database.
and when the user sign in into his or her account he can download his own
files.
|
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 on a link and after a moment or two a file download dialog box pops-up in your web browser and prompts you for some instructions, such as “open” or “save“. I’m going to show you how to do that using a perl script.
What You Need
Any recent...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |