FTP using ASP

Discussion in 'ASP General' started by AP, Jan 3, 2010.

  1. AP

    AP Guest

    Is it possible to use ASP to "FtpPut" or "FtpDelete" a file in an FTP
    server ?

    For example, in VBA I can do the following to "put" a file to an FTP
    server (can something similar be done in ASP - I'm just doing a
    feasibility study to see if ASP is the correct platform for me -
    thanks):

    Public hConnection As Long, hOpen As Long, sOrgPath As String
    Public Const INTERNET_OPEN_TYPE_PRECONFIG = 0
    Public Const INTERNET_DEFAULT_FTP_PORT = 21
    Public Const INTERNET_SERVICE_FTP = 1
    Public Const INTERNET_FLAG_PASSIVE = &H8000000
    Public Const FTP_TRANSFER_TYPE_UNKNOWN = &H0

    'Connect FTP server
    strLogon = "xxxxxxx"
    strPwd = "xxxxxxx"
    hOpen = InternetOpen("Example", INTERNET_OPEN_TYPE_PRECONFIG,
    vbNullString, vbNullString, 0)
    hConnection = InternetConnect(hOpen, FtpServer,
    INTERNET_DEFAULT_FTP_PORT, strLogon, strPwd, INTERNET_SERVICE_FTP, IIf
    (PassiveConnection, INTERNET_FLAG_PASSIVE, 0), 0)
    sOrgPath = String(MAX_PATH, 0)
    FtpGetCurrentDirectory hConnection, sOrgPath, Len(sOrgPath)

    'FTP
    subfolder_name = "xxxxxxx"
    FtpSetCurrentDirectory hConnection, subfolder_name
    FtpPutFile hConnection, "C:\" & f & ".txt", f & ".txt",
    FTP_TRANSFER_TYPE_UNKNOWN, 0
    AP, Jan 3, 2010
    #1
    1. Advertising

  2. Gazing into my crystal ball I observed AP <> writing in
    news::

    > Is it possible to use ASP to "FtpPut" or "FtpDelete" a file in an FTP
    > server ?
    >
    >


    I have used the method mentioned here for quite a while and it works just
    fine:

    <http://dypso.free.fr/tech/asp-ftp-recuperer-fichier-sans-composant-en.php>
    (watch wrapping)

    --
    Adrienne Boswell at Home
    Arbpen Web Site Design Services
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
    Adrienne Boswell, Jan 5, 2010
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. someone

    FTP over SSL vs FTP over SSH

    someone, Apr 24, 2004, in forum: Java
    Replies:
    1
    Views:
    4,546
    iksrazal
    Apr 25, 2004
  2. Replies:
    3
    Views:
    5,582
  3. Jeff Miller
    Replies:
    0
    Views:
    460
    Jeff Miller
    Mar 26, 2009
  4. D. Buck
    Replies:
    2
    Views:
    447
    D. Buck
    Jun 29, 2004
  5. Asaf Sinai
    Replies:
    1
    Views:
    224
    Chris Davies
    Jul 4, 2006
Loading...

Share This Page