Getting Remote Files With ASP Continued (Page 1 of 5 )
This second article will show how to send remote binary files, multiple files, and additional information with only ASP and XML. This is an incredibly powerful technique, and the implementation in this two part series will deal with automatically updating a deployed ASP web application.
There is a file available for download for this article here.
Introduction
The first article in this two-part series handled the client portion of transmitting files – even binary files – using only XML and ASP. This is a very powerful extension to my previous tutorial on how to retrieve remote pages and save them locally. Of course all the work we discussed in the last article is no good on the client side, without a server to process the request and encode the files to send back to the client.
Once again, this article is derived from code used for an impressive ‘auto-update’ feature to a popular e-commerce solution, Mall23 (http://www.mall23.com/store/Default.asp?vf=14). The deployed versions of the application can query the master server for updated versions, and download and install any modified files. Make sure you’ve read the previous article on how to send the request, process the response, and save the files.
But how does the server actually encode and send the files? Well, the first thing we start with is a query from the client application. As I mentioned previously, the ‘client’ is technically a server-based web application, but it is referred to as a client of the master application. This query can be any data you’d like to send the server, but in our example, the client is sending the sGenKey (license key) and the sCurrentVersion (the version the client is currently running).
It is advantageous to transmit a license key, as it can be checked against your database to validate it. This way you can ensure that the license accompanies software that has been paid for, and that the client’s auto-update subscription hasn’t expired. You could even match this to server names, to ensure that pirated versions of your application aren’t being leaked out. I’ll leave that up to your creative mind!
Next: Let’s Code >>
More ASP Code Articles
More By Justin Cook