A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.
When I run this function I get an error message: Error opening script file FTP_cmd.txt
Public Function FTP_SendOneFile(strPath As String, strfilename As String) '========================================================================= 'FTP from Microsoft Access 'by Matthew V Carmichael 'Creates FTP Batch File, FTP command file (txt) 'Default directory location of files to upload/download is 'the same location as the mdb file that contains this module. 'Modified by Dale Fye on 9/12/2016 '=========================================================================' On Error GoTo Err_Trap Dim pFile As Long Dim ftpServer As String Dim strUserName As String Dim strPassword As String Dim ftpFolder As String Dim dtNow As Date If right(strPath, 1) <> "\" then strPath = strPath & "\" If Dir(strPath & strfilename) = "" Then MsgBox "File not found." Exit Function End If If Dir(strPath & "FTP_cmd.txt") <> "" Then Kill strPath & "FTP_cmd.txt" If Dir(strPath & "FTP_run.bat") <> "" Then Kill strPath & "FTP_run.bat" 'FTP Server Settings ftpServer = "ftpserver" ftpFolder = "MyFolder" strUserName = "UserName" strPassword = "password" 'Create text file containing FTP commands pFile = FreeFile Open strPath & "FTP_cmd.txt" For Output As pFile Print #pFile, "user" & " " & strUserName Print #pFile, strPassword Print #pFile, "cd " & Chr$(34) & ftpFolder & Chr$(34) Print #pFile, "Put " & Chr$(34) & strfilename & Chr$(34) 'Use the Put command to upload, use the Get command to download. 'Print #pFile, "Get " & "Your File Name" Print #pFile, "Pause" Print #pFile, "quit" Close pFile 'Create batch file to execute FTP pFile = FreeFile Open strPath & "FTP_Run.bat" For Output As pFile Print #pFile, "ftp -n -s:FTP_cmd.txt" & " " & ftpServer Print #pFile, "Pause" Close pFile 'Execute FTP command 'Shell strPath & "FTP_Run.bat", 1 Err_Trap_Exit: Exit Function Err_Trap: MsgBox Err.Number & " - " & Err.Description Resume Err_Trap_Exit End Function
user Username Password cd "MyFolder" Put "test file 2016_09_12_1400.txt" Pause quit
ftp -n -s:FTP_cmd.txt ftpServer Pause
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|C# Windows Form Navigation - Total Beginner||9||38|
|The sign-in method you're trying to use isn't allowed. for more info, contact your network administrator and Can't logon because the logon method you are using is not allowed on this computer||2||22|
|add dollar amount in VB code, Access 2003||6||12|
|Windows Update for Skype Meeting App?||1||16|