From: AP on 3 Jan 2010 08:39 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
|
Pages: 1 Prev: Free ASP.NET and Database Web Host Next: Export to PDF font trouble |