ASP Code
  Home arrow ASP Code arrow Page 3 - Getting Remote Files With ASP Continued
Iron Speed
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  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Actuate Whitepapers 
VeriSign Whitepapers 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
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 CODE

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

    Table of Contents:
  • Getting Remote Files With ASP Continued
  • Let’s Code
  • PerformUpdate() Explained
  • ProcessFile() Explained
  • Conclusion

  • 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

    At the virtual BlackBerry Technical Seminar 2008, you can ask your development questions directly of Research In Motion® (RIM) experts, and take advantage of learning opportunities designed uniquely for BlackBerry solution developers. Register Today!

    Getting Remote Files With ASP Continued - PerformUpdate() Explained


    (Page 3 of 5 )

    Once we are sure we want to perform the update (the license key has checked out as legitimate), we can begin creating the XML document to send back to the client. In this example, the parent node of our XML is ‘MALL23’. You can customize this for your own application.

    Within the parent node, there are three child nodes: MESSAGE, VERSION, and CODE.

    • The MESSAGE node holds error or success codes, or action codes for the client to perform.
    • The VERSION node holds the version that the client is being updated to. This way, the client will know what version it will be on once the update has been completed. As I mentioned in the previous article, it would be wise to store this in a local config file on the client, and read the version each time.
    • The CODE node is optional code to run on the client that is not part of the normal update. This can be used for many purposes, to activate or deactivate a client, grant or revoke administrator rights, rename or move files, reverse product SKUs (kidding!)...

    Sub PerformUpdate()

          Dim oRoot, oElement, objFolder, objItem2

          xmlDOMDocument.loadXML "<MALL23 />"

         

          Set oRoot = xmlDOMDocument.documentElement

         

          Set oElement = xmlDOMDocument.createElement("MESSAGE")           

          oElement.nodeTypedValue = "error, success or action messages to send to the client"

          oRoot.appendChild oElement

         

          Set oElement = xmlDOMDocument.createElement("VERSION")

          oElement.nodeTypedValue = "version that the client is being update to"

          oRoot.appendChild oElement

         

          Set oElement = xmlDOMDocument.createElement("CODE")        

          oElement.nodeTypedValue = "misc. code to be processed by the client application"

          oRoot.appendChild oElement

         

          Set objFolder = fsoFileObject.GetFolder(Server.MapPath("Updates/"))

          For Each objItem2 In objFolder.Files

                Call ProcessFile(objItem2.Path)

          Next

          Set objFolder = Nothing

          xmlDOMDocument.save(Response)

    End Sub

    For this example, the update files exist in a subfolder called “Updates”. You can change it to whatever you like. The most practical thing to do in a professional application with many subfolders is to put the exact subfolders within the Updates folder, and traverse through them. You can automate your code versioning system to place a copy of the updated files into their respective subfolders in the ‘update’ directory.

    The PATH node (see the Client Side Parse section of the previous article) contains the relative folder path for each file anyway. That way, the exact folder structure will be transmitted and retained on the client version of the application. For the sake of simplicity, the example just loops through all the files in the ‘Updates’ folder, no subfolders.

    You’ll notice that for each file in the ‘Updates’ folder, the ProcessFile() subroutine is called. Let’s examine that now.

    More ASP Code Articles
    More By Justin Cook


       · Hi, this is just a note to all readers: hope you enjoy my article!
       · I need to be able to browse images at the computer and uplodade to the web page, can...
       · no, i would just use ASPupload for that
       · I love the article and it was very informing. Is there a way to accomplish the same...
     

    ASP CODE ARTICLES

    - ASP Forms
    - ASP: The Beginning
    - Getting Remote Files With ASP Continued
    - Inbox and Outbox Manipulation in ASP
    - Relational DropDownList Using VB.NET
    - Ad Tracking URL Hits
    - Use ViewState to display one record per page...
    - Send Email using ASP.NET formatted in HTML
    - ASP File Explorer
    - ASP/XML Interview questions by Srivatsan Sri...
    - Various methods of setting Date values to a ...
    - Conditional DataGrid Item and using checkbox...
    - Fill .NET Listbox with SQL DataReader
    - Filling Dropdown box using Code-Behinds in C#
    - FLAMES code sample written in .NET What is F...

    Click Here




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway