worfire Posted June 19, 2012 Share Posted June 19, 2012 (edited) hello to everyone.I'm trying to accomplish the following action:I have a file. txtI have an ftp server = ftp://127.127 ....this server is a folder called / COCI'm trying to do is the followingI want to send. txt file into the folder / COChowever I'm not gettingthe maximum is that I can play the file on the ftp, but he goes to themy code:#include <FTPEx.au3>Local $s_LocalFile = "d:documents and settingsE144667Meus documentosCOC_Painel_Report.txt"Local $s_RemoteFile = 'ftp://127.127/COC/COC_Painel_Report.txt'Local $server = '127.127....'Local $username = 'logn'Local $pass = 'pass'Local $Open = _FTP_Open('TelefonicaFTP')Local $Conn = _FTP_Connect($Open, $server, $username, $pass)_FTP_FilePut($Conn , $s_LocalFile, $s_RemoteFile , $FTP_TRANSFER_TYPE_BINARY , 0)Local $Ftpc = _FTP_Close($Open)Can someone help me? Edited June 19, 2012 by worfire Link to comment Share on other sites More sharing options...
water Posted June 19, 2012 Share Posted June 19, 2012 (edited) Are you sure you have to specify protocol and IP in the remote filename? I would try: Local $s_RemoteFile = '/COC/COC_Painel_Report.txt' Edited June 19, 2012 by water My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
digiworks Posted June 19, 2012 Share Posted June 19, 2012 #include <FTPEx.au3> Local $s_LocalFile = "d:documents and settingsE144667Meus documentosCOC_Painel_Report.txt" Local $s_RemoteFile = "COC_Painel_Report.txt" Local $server = '127.127....' Local $username = 'logn' Local $pass = 'pass' Local $Open = _FTP_Open('TelefonicaFTP') Local $Conn = _FTP_Connect($Open, $server, $username, $pass) _FTP_DirSetCurrent($Conn, "/COC/") _FTP_FilePut($Conn , $s_LocalFile, $s_RemoteFile , $FTP_TRANSFER_TYPE_BINARY , 0) Local $Ftpc = _FTP_Close($Open) Link to comment Share on other sites More sharing options...
worfire Posted June 19, 2012 Author Share Posted June 19, 2012 Are you sure you have to specify protocol and IP in the remote filename? yes I would try: Local $s_RemoteFile = '/COC/COC_Painel_Report.txt' obs. still can not Link to comment Share on other sites More sharing options...
digiworks Posted June 19, 2012 Share Posted June 19, 2012 You don't specify the protocol/ip.. Have you tried the script I posted? Link to comment Share on other sites More sharing options...
worfire Posted June 19, 2012 Author Share Posted June 19, 2012 yes tested it, but still can not Link to comment Share on other sites More sharing options...
water Posted June 19, 2012 Share Posted June 19, 2012 (edited) Then I would suggest you add some debugging code. Something like: #include Local $s_LocalFile = "d:documents and settingsE144667Meus documentosCOC_Painel_Report.txt" Local $s_RemoteFile = "COC_Painel_Report.txt" Local $server = '127.127....' Local $username = 'logn' Local $pass = 'pass' Local $Open = _FTP_Open('TelefonicaFTP') ConsoleWrite(@error & "-" & @extended & @CRLF) Local $Conn = _FTP_Connect($Open, $server, $username, $pass) ConsoleWrite(@error & "-" & @extended & @CRLF) _FTP_DirSetCurrent($Conn, "/COC/") ConsoleWrite(@error & "-" & @extended & @CRLF) _FTP_FilePut($Conn , $s_LocalFile, $s_RemoteFile , $FTP_TRANSFER_TYPE_BINARY , 0) ConsoleWrite(@error & "-" & @extended & @CRLF) Local $Ftpc = _FTP_Close($Open) ConsoleWrite(@error & "-" & @extended & @CRLF)What do you get? Edited June 19, 2012 by water My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
worfire Posted June 19, 2012 Author Share Posted June 19, 2012 with your code, it sends the file to the ftp server, but he did not send it to the folder COC, it leaves the server in gereal, but sends it to the folder. Link to comment Share on other sites More sharing options...
water Posted June 19, 2012 Share Posted June 19, 2012 What do you see on the SciTE console? Or do you compile the script and run the EXE? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
worfire Posted June 19, 2012 Author Share Posted June 19, 2012 if my script#include <FTPEx.au3>Local $s_LocalFile = "d:documents and settingsE144667Meus documentosCOC_Painel_Report.txt"Local $s_RemoteFile = "COC_Painel_Report.txt"Local $server = 'ftp://192.168.236.47'Local $username = 'login'Local $pass = 'pass'Local $Open = _FTP_Open('Raiz FTP')ConsoleWrite(@error & "-" & @extended & @CRLF)Local $Conn = _FTP_Connect($Open, $server, $username, $pass)ConsoleWrite(@error & "-" & @extended & @CRLF)_FTP_DirSetCurrent($Conn, "/COC/")ConsoleWrite(@error & "-" & @extended & @CRLF)_FTP_FilePut($Conn , $s_LocalFile, $s_RemoteFile , $FTP_TRANSFER_TYPE_BINARY , 0)ConsoleWrite(@error & "-" & @extended & @CRLF)Local $Ftpc = _FTP_Close($Open)ConsoleWrite(@error & "-" & @extended & @CRLF)i dont use .execonsole:>Running:(3.3.8.1):Arquivos de programasAutoIt3autoit3.exe "d:documents and settingsE144667Desktopteste6.au3" --> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop0-0-1-12007-1-6-1-60-0+>11:05:37 AutoIT3.exe ended.rc:0>Exit code: 0 Time: 2.390 Link to comment Share on other sites More sharing options...
worfire Posted June 19, 2012 Author Share Posted June 19, 2012 (edited) managed to solve the problemthe "/" was the problem as an example below, I pulled out and workedfinal code:#include <FTPEx.au3>Local $s_LocalFile = "d:documents and settingsE144667Meus documentosCOC_Painel_Report.txt"Local $s_RemoteFile = "COC_Painel_Report2.txt"Local $server = '192.168.236.47' <<<<<<<<<<< retired ftp://Local $username = 'login'Local $pass = 'pass'Local $Open = _FTP_Open('Raiz FTP')ConsoleWrite(@error & "-" & @extended & @CRLF)Local $Conn = _FTP_Connect($Open, $server, $username, $pass)ConsoleWrite(@error & "-" & @extended & @CRLF)_FTP_DirSetCurrent($Conn, "COC/") <<<<<<<<< retired "/"ConsoleWrite(@error & "-" & @extended & @CRLF)_FTP_FilePut($Conn , $s_LocalFile, $s_RemoteFile , $FTP_TRANSFER_TYPE_BINARY , 0)ConsoleWrite(@error & "-" & @extended & @CRLF)Local $Ftpc = _FTP_Close($Open)ConsoleWrite(@error & "-" & @extended & @CRLF)very very thx @water for you code Edited June 19, 2012 by worfire Link to comment Share on other sites More sharing options...
water Posted June 19, 2012 Share Posted June 19, 2012 Glad you could solve the problem My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now