ASP
  Home arrow ASP arrow Getting Remote Files With ASP
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP

Getting Remote Files With ASP
By: Justin Cook
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 58
    2005-08-09

    Table of Contents:
  • Getting Remote Files With ASP
  • The Concept
  • The Code Client Script Initialization
  • PerformUpdate() Explained
  • WriteFile() Explained

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Getting Remote Files With ASP


    (Page 1 of 5 )

    This article will show how to retrieve 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.


    A file is available to download for this article here.

    Introduction

    One of the most popular articles I’ve written was “Getting Remote Pages with ASP.” It seems that people found it as much of a  lifesaver as I did, and were able to extend it in some very creative ways. This series of two articles deals with the best ones I’ve heard yet.

    The programmer behind the popular e-commerce Web application Mall23
    (http://www.mall23.com/store/Default.asp?vf=14) contacted me, asking me if I’d be interested in writing about his application. He told me he was able to extend the process of retrieving remote pages, to actually be able to retrieve remote binary files. This was his dilemma, to which you as a developer can no doubt relate:

    “After developing several applications deployed to the public, I kept running into the same problem time and time again –- how to deploy updates. If you have ever used a third party ASP application, you know what I’m talking about. You install the software on your server and it sits, and sits. Six months later you find out that there have been three updates and tons of bug fixes. Problem is that no one told you about the updates, and now you have to figure out how to apply three different patches without destroying your site.”

    “On the other hand, as a developer, it gets to be mind-boggling after deploying 30 different updates. Which customer has which version? Which client has modified what in which version? In the past, I’ve always added a version identifier to my software and had my patches loop through and update to the current version. Nice, but doesn’t solve the problem of making it transparent for the site owner. Many times I would find small bugs (like a misspelled word), and I’d have to sit on it until I had enough to justify my creating a whole new deployment, announcing it to the public, and getting them to spend the time to download and install it. What a pain. For everyone.”

    It seems that major software developers had already solved this issue for client-based applications, devising a system call “auto-update.” Unfortunately, ASP has no inherent way of transferring files, let alone binary files!

    My previous article described how to use a free, Microsoft-provided XMLHTTP object to retrieve Web pages as XML, and save them locally. While this works great for the Web, XML, and even text, it seems it just can’t be done for binary files.

    Well if there’s one phrase that most developers refuse to utter or believe, “it can’t be done” is it! With no small amount of programming ingenuity -- and one more free tool provided by Microsoft -- a clean (and extensible) solution was created.

    Microsoft has built a Base64-to-XML converter, called Msxml2.DOMDocument. We’ll use it to encode and decode the files, XMLHTTP to transmit the files, and finally ADO to save the files.

    Before We Proceed

    This article will make use of the MSXML2.ServerXMLHTTP object. Make sure you have this installed on the machine from which the script is running. You can find the Microsoft XML parser 3.0 sp4 here:  http://www.microsoft.com/downloads/details.aspx?FamilyId=C0F86022-
    2D4C-4162-8FB8-66BFC12F32B0&displaylang=en

    More ASP Articles
    More By Justin Cook


       · Getting Remove Files is very nice article. But It will be so good if the screen...
     

    ASP ARTICLES

    - Using MySQL with ASP
    - ADO for the Beginner
    - ADO.NET 101: Data Rendering with a DataGrid ...
    - Introducing SoftArtisans OfficeWriter 3.0 En...
    - Getting Remote Files With ASP
    - The Real Basics of Functions in ASP
    - Enhancing Readability with ASP
    - Mimicking PHP's String Formatting Functions
    - Windows Server Hacks 12, 77, and 98
    - How to Sort a Multi-Dimensional Array
    - Developing an Information Management Tool wi...
    - What are Active Server Pages?
    - Getting Remote Pages with ASP
    - FTP’ing Files with ASP
    - Apply Single-Sign-On to Your Application





    © 2003-2010 by Developer Shed. All rights reserved. DS Cluster 8 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek