Jump to content
Sign in to follow this  
vaibhavs

FTP Problem

Recommended Posts

vaibhavs

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

Share this post


Link to post
Share on other sites
vaibhavs

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

Share this post


Link to post
Share on other sites
Richard Robertson

You don't need to include GUIConstants or IE UDFs because you aren't calling them.

I'm really not sure what would be wrong with that script though, unless the name/password was wrong and the connection was just rejected.

Share this post


Link to post
Share on other sites
Kip

192.168.1.4 is someone else in your network, isn't? 192.168.1.1 is the default of linksys

Edited by kip

Share this post


Link to post
Share on other sites
Rick

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

Share this post


Link to post
Share on other sites
vaibhavs

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

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  

×