SunQuest
 
       ASP
  Home arrow ASP arrow FTP’ing Files with ASP
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

FTP’ing Files with ASP
By: Justin Cook
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 175
    2004-01-21

    Table of Contents:
  • FTP’ing Files with ASP
  • Variable: Having No Fixed Quantitative Value
  • The Great FTP Function
  • 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

    Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!

    FTP’ing Files with ASP


    (Page 1 of 4 )

    Would you like the ability to transfer files from your ASP app with the greatest of ease? Forget downloading and installing server-side components, forget spending money. Forget inefficient and/or cryptic coding! This article demonstrates how easy it is to embed file transfer functionality into your application. Just for the record, This concoction more or less saved my life at one point, and I presume it will do no less than the same for you.

    A general rule to programming is that virtually no problem is unique. To illustrate: some time ago, I was building a content management system in ASP, and came up against what seemed to be a major barrier. I had all my templates working wonderfully on the content staging server, pulling their content from a MySQL database. But the pages could only be served to the World Wide Web in static HTML format, from a UNIX server somewhere in the States. How on Earth could I publish the content statically, and then get them to their host? Quite the conundrum!

    I worked out a method to publish the pages, directory structure and all. Who knows, maybe that will be the subject of a future article. This one however, is written for the sole purpose of explaining how the heck I got those HTML files to move.

    It was quickly discerned that I’d best use FTP as the protocol by which to transfer the files (wink wink). A quick search on Google informed me that thousands of other developers were discerning the very same thing, and like me, were looking for the way to do it.  Most, like me again, do not want to put out money, or install components, for something they believe they should be able to efficiently code by themselves.

    So I’m going to show you how I did it!

    Goals

    It seems that most people have similar goals as me in the FTP via ASP issue (though that’s where the similarities seem to end!). We all have one or more files, sitting in one or more directories, that we need to transfer to one or more hosts, one or more times. Ok, perhaps a confusingly vague sentence. All I’m saying is that we need to transfer a file (one or more…) and that’s all. We don’t need a GUI, a progress bar, a KB/second indicator, a queue, or anything to resume broken downloads. We just want to take a group of 0’s and 1’s at point A, and get them to point B.

    So that’s all I’ve built, a plain-vanilla FTP function. You may prefer chocolate, or even strawberry, but I assure you it works perfectly!

    Prerequisites

    This article assumes a solid grasp on copying & pasting text, a Microsoft Windows environment in which you’re hosting your ASP files, and some good strong coffee (optional).

    The reason for the Windows requirement is that we’ll be using the inbuilt ftp.exe, and some Windows shell scripting in your ASP page.

    More ASP Articles
    More By Justin Cook


       · Thank you very much for your spectacular and entertaining code!However, I don't...
     

    ASP ARTICLES

    - 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
    - Easy Error Management

    Iron Speed




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