Jump to content

Recommended Posts

Posted

Hi,

Client : XP Prof (Firewall, Antivirus Disabled)

Server: FedoraCore4 in local lan

I have copied the FTP.AU3 from this link http://www.autoitscript.com/forum/index.php?showtopic=12473

to this location : C:\Program Files\AutoIt3\Include

The following script does not work. No error message either.

I have tried to upload the script using FTPEx and it work fine.

But not via AutoIt3 script.

I have searched a lot on this forum, but could not comeup with any solution.

Please help!!!!

Thx

Vai

#include <GUIConstants.au3>
#include <INet.au3>
#include <ftp.au3>

    $server = '192.168.1.4'
    $username = 'root'
    $pass = 'mypassword'
    
    $Open = _FTPOpen('MyFTP Control')
    $Conn = _FTPConnect($Open, $server, $username, $pass)
    $Ftpp = _FtpPutFile($Conn, 'C:\scrshot090.JPG', '/root/ZZZZZZZ.JPG')
    $Ftpc = _FTPClose($Open)

msgbox(16, "Status", "FTP Done")
Posted

Another observation (if it helps), the msgbox appears as soon as I press F5.

Looks like the script does not even attempt to connect to 192.168.1.4.

Thx

Posted (edited)

you need two addional lines...

#include <GUIConstants.au3>

#include <INet.au3>

#include <ftp.au3>

$Dll=DllOpen("Wininet.dll")

$server = '192.168.1.4'

$username = 'root'

$pass = 'mypassword'

$Open = _FTPOpen('MyFTP Control')

$Conn = _FTPConnect($Open, $server, $username, $pass)

$Ftpp = _FtpPutFile($Conn, 'scrshot090.JPG', '/root/ZZZZZZZ.JPG')

$Ftpc = _FTPClose($Open)

DllClose($Dll)

msgbox(16, $Conn, "FTP Done")

altho $conn returns 0 in this example which probably means $server, or $username,

or $pass is wrong.

Edited by Rick

Who needs puzzles when we have AutoIt!!

Posted

Bingo!!!! It worked.

I was missing the DLL calls.

It was not mentioned in the example script. Hence I lost on it.

Thank you Rick for your help.

Really appreciate it.

cheers,

Vai

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