Jump to content

Recommended Posts

Posted (edited)

hello to everyone.

I'm trying to accomplish the following action:

I have a file. txt

I have an ftp server = ftp://127.127 ....

this server is a folder called / COC

I'm trying to do is the following

I want to send. txt file into the folder / COC

however I'm not getting

the maximum is that I can play the file on the ftp, but he goes to the

my 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 by worfire
Posted (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 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

 

Posted

#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)

Posted

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

Posted (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 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

 

Posted

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.

Posted

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

 

Posted

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 .exe

console:

>Running:(3.3.8.1);):Arquivos de programasAutoIt3autoit3.exe "d:documents and settingsE144667Desktopteste6.au3"

--> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop

0-0

-1-12007

-1-6

-1-6

0-0

+>11:05:37 AutoIT3.exe ended.rc:0

>Exit code: 0 Time: 2.390

Posted (edited)

managed to solve the problem

the "/" was the problem as an example below, I pulled out and worked

final 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 by worfire
Posted

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

 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...