How to receive a binary file from a webserver

V

Victor Espina

Hi.

I developed a sales app for PPC using NETcf 1.0. This app can connect to
a remote webserver at certain point to retrieve and send data in XML format.

Now my customer ask me to implement some kind of "auto-update" feature,
in order to automatically checks if a new version of the app is
available (assuming there is an available internet connection), download
it and then run the new version.

Getting the current app version in the remote server is easy: I just
added a new method to my webserver called getCurrentVersion(). What I
need to figure it out is how to download the new app's dll using a
method of the webserver.

I know I could use FTP for this kind of things, but my customer don't
allow me to use or install any FTP server for security reasons. So, I'm
stucked with the webserver.

any ideas? can I define a webmethod that returns a byte stream? does
NETcf supports Base64 strings ?

TIA

Victor Espina
 
N

Neil Cowburn

The CF does indeed support Base64 encoding and so you can download binary
images via Web services. That said, it's not the most efficient use of the
limited bandwidth available on most devices. Use Tomer's suggest of a direct
HTTP transfer. That way you can apply HTTP compression and reduce the
bandwidth usage.

--
Neil Cowburn
Principal Partner
OpenNETCF Consulting, LLC.

http://www.opennetcf.com/
 
N

Neil Cowburn

Executables compress download quite a lot a they usually contain a
substantial amount of whitespace.

As for chunking, you can still do that via the direct HTTP method. The HTTP
headers will contain the length of the file and by using
HttpWebRequest/HttpWebResponse, you can get a reference to the network
stream and then read the file from the stream in chunks.

--Neil


--
Neil Cowburn
Principal Partner
OpenNETCF Consulting, LLC.

http://www.opennetcf.com/
 
V

Victor Espina

Hum. I was taking side for base64 solution, because that way I could
divide the hole file in small chunks and show an accurate progress bar
at client's side.

As the file I will download is an EXE file (about 200 Kb), how smaller
will be that file after HTTP compression?

Thanks a lot for your answers

Victor Espina
 
V

Victor Espina

Thanks, Neil and Tomer. I'll take a look of what you recomend.

LOT

Victor Espina
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top