Sign in to follow this  
Followers 0
worfire

Help FTP Transfer..

12 posts in this topic

#1 ·  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

Share this post


Link to post
Share on other sites



#2 ·  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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

You don't specify the protocol/ip.. Have you tried the script I posted?

Share this post


Link to post
Share on other sites

yes tested it, but still can not

Share this post


Link to post
Share on other sites

#7 ·  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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#11 ·  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

Share this post


Link to post
Share on other sites

Glad you could solve the problem ;)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0