iASP_Inet Component

Overview

The Instant Active Server Page InterNEt Transfer (iASP_Inet) component is used to get and put the desired files from iASP at the remote side via FTP. 

Methods

FTPGetFile

boolean FtpGetFile(String, String, String, String, String, boolean, int):  This method is used to get the desired Remote file from the FTP Server and save it to the specified path. Use the following syntax:

FtpGetFile("HostName","UserName","Password","RemoteFileName"."LocalFileName",boolOverwrite,Mode)

Argument

Description

HostName  Name of the Host Machine where FTP Server runs.
User Name Name of the user to be connected to the FTP Server.
Password It provides security for the users data. It authorizes to communicate with the FTP Server.
RemoteFile File which exists at the remote side.
LocalFile  Local file by which the remote file is to be saved.
BooleanOverwrite A boolean variable asks whether to overwrite the present file or not.
Mode It has two modes, '1'  represents 'ASCII' and '2' represents 'Binary' mode. Choose any one mode.

Write Visual Basic scripts on the notepad to communicate with the FTP Server.  Object needs to be created to get and put the desired files.

Use the FtpGetFile method to get the file from the FTP Server:

  1. Click on the Start button of the window, drag the mouse to Program and then to Accessories. From Accessories click on the notepad.
  2. Create Object by using the CreateObject statement:

    Set FtpCon = Server.CreateObject("ASPInet.FTP")
  3. Now call the method:

    FtpCon.FtpGetFile
    ("HostName","UserName","Password","Remote
    FileName"."LocalFileName",BooleanOverWrite",Mode")

It gets the desired remote file from the FTP Server by reading the appropriate arguments mentioned in the bracket, and saves it to the local side.

FTPPutFile

boolean FtpPutFile(String, String, String, String, String, int): This method is used to transfer the Local file to the Ftp Server. Use the following syntax:

FtpPutFile("HostName", "UserName", "Password","RemoteFileName","LocalFileName",Mode)

Argument

Description

HostName  Name of the Host Machine where FTP Server runs.
User Name Name of the user to be connected to the FTP Server.
Password It provides security for the users data. It authorizes to communicate with the FTP Server.
RemoteFile File which is to be stored at the remote side
LocalFile  Local file by which the remote file is to be saved.
Mode It has two modes, '1'  represents 'ASCII' and '2' represents 'Binary' mode. Choose any one mode.
  • Write Visual Basic scripts on the notepad to communicate with the FTP Server.  Object needs to be created to get and put the desired files.

    Use the FtpPutFile method to transfer the desired file to the FTP Server:

    1. Click on the Start button of the window, drag the mouse to Program and then to Accessories. From Accessories click on the notepad.
    2. Create Object by using the CreateObject statement:

      Set FtpCon = Server.CreateObject("ASPInet.FTP")
    3. Now call the method:

      FtpCon.FtpPutFile ("HostName","User","Password","Remote FileName"."LocalFileName",Mode")

      It transfers the local file to FTP Server by reading the appropriate arguments mentioned in the bracket.

getLastError

This method returns the last error that occurred during communication.

Use the getLastError method to get the last error that occurred during the communication.

  • Set the getLastError method:

    FtpCon.getLastError

Errors

The following table shows the errors you can receive when using the iasp_Inet component.

Error

Constant

Description

NO_ERROR 0 Represents no error.
UNKNOWN_HOST 1 HOST is not found.
USER_CANNOT_LOGIN  2 The given password and login name are not correct. 
REMOTE_FILE_NOT_FOUND 3 File requested by the Get method does not exist at the  remote side.
LOCAL_FILE_NOT_FOUND 4 Local file is not present.
INVALID_PATH 5 Given path to Put the file is not valid.
ACCESS_DENIED 6 Access to Put the file at FTP Server is denied.
INVALID_MODE 7 The mode is not valid.

If you require technical support please send complete details about the problem you are having to support@halcyonsoft.com.


Copyright © 1998-2002, Halcyon Software Inc. All rights reserved.