# Little help with FTP.au3

## Recommended Posts

This is the first time I'm using FTP.au3, so I was expecting errors at some point, but not that soon! With that said, I'm really ashamed to post this but I can't connect to my server, let alone upload a file, using the same syntax provided in FTP_Example.au3.

Here's my code, and for obvious reasons I ommit the variable values:

#include <FTP.au3>

$server = 'ftp.subdomain.mydomain.com.mycountry'$username = 'myuser'
$pass = 'mypass'$Open = _FTPOpen('MyFTP')
if @error then
msgbox(0,"","fail_open")
endif
$Conn = _FTPConnect($Open, $server,$username, $pass) if @error then msgbox(0,"","fail_connect") endif$Ftpp = _FtpPutFile($Conn, 'Drive:\PathToFile\Filename, '/Folder/FileName') if @error then msgbox(0,"","fail_upload") endif$Ftpc = _FTPClose($Open) if @error then msgbox(0,"","fail_close") endif [code=auto:0] Client info as follows: I have wininet.dll (placed on the system folder), and i'm using v3.1.1.87 which has DllCall which meets the requirements specified in the UDF. OS is XP (home edition) Server info OS is Linux. I created a user with ftp read & write permissions on the server subdomain. I can successfully upload files to the subdomain with an FTP client using the user and password combination, but I get an error in the connection (the message box appears) and of course, the upload also fails. There's a couple of things I ought to say, my username has a '@domain' attatched to it, which is automatically appended by my server control pannel, but I have no problems with my client application using this complete username, and the only difference is that I can specify port number=21 in this application. Although it should have no implications, I also made sure that the folder I'm uploading to is not password protected. I've also tried every slash adding removing trick, changing single to double quotes, and everything I could think of, but It's not connecting. I tried to be as specific as possible, so I can get guidance and I can't think of anything else. If someone knows where I'm going wrong, I'd really appreciate some help here. Thanks in advance IVAN Think out of the boxGrabber: Yet another WinInfo tool_CSVLib (still alpha)Dynamic html in au3 Share this post Link to post Share on other sites (adsbygoogle = window.adsbygoogle || []).push({}); w0uter 1 w0uter 1 resreveR nA Active Members 1 2,204 posts Report post Posted December 1, 2005 (edited) i hate it when my things dont work, im sorry try using the old version that uses the build in ftp.exe see my sig Edited December 1, 2005 by w0uter My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Share this post Link to post Share on other sites ivan 1 ivan 1 Universalist Active Members 1 399 posts Report post Posted December 1, 2005 Thanks a million. You don't know how much I appreciate it, seriously! Think out of the boxGrabber: Yet another WinInfo tool_CSVLib (still alpha)Dynamic html in au3 Share this post Link to post Share on other sites ivan 1 ivan 1 Universalist Active Members 1 399 posts Report post Posted December 1, 2005 I did copied the file as FTPxxx.au3 to the include folder and after executing the following: #include <FTPxxx.au3> _FTPput("http://www.subdomain.domain.com", @scriptdir &"\file.txt'", "username", "pass", "folder", 1) I got the following error message: C:\Program Files\AutoIt3\Include\FTPxxx.au3(57,67) : ERROR:$i_p_Check already declared as parameter

If StringInStr($s_p_PathFile, "*") <> 0 Then Local$i_p_Check = 0

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\FTPxxx.au3(182,67) : ERROR: $i_d_Check already declared as parameter If StringInStr($s_d_PathFile, "*") <> 0 Then Local \$i_d_Check = 0

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\FTPxxx.au3 - 2 error(s), 0 warning(s)

>AU3Check Ended.

>Running: (3.1.1.90):C:\Program Files\AutoIt3\beta\autoit3.exe "C:\Program Files\AutoIt3\Include\FTPxxx.au3"

>AutoIT3.exe ended.

>Exit code: 0 Time: 6.052

I commented these lines and executed the code and got

>Running AU3Check...C:\Program Files\AutoIt3\SciTe\Defs\Unstable\Au3Check\au3check.dat

>AU3Check Ended.

>Running: (3.1.1.90):C:\Program Files\AutoIt3\beta\autoit3.exe "C:\Program Files\AutoIt3\Include\FTPxxx.au3"

>AutoIT3.exe ended.

>Exit code: 0 Time: 3.041

but no file was transferred.

By the way and just to confirm if I get the principle, when you wrote "try using the old version that uses the build in ftp.exe", does this means that the code uses the ftp.exe 40kb application in the system folder?

Thanks again.

IVAN

##### Share on other sites

just remove the Local

and yes you have the principle right.

but how can you put something on an HTTP:// protocol

Edited by w0uter

My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll

##### Share on other sites

Just in case anyone looks at this thread again, it worked wonders, after getting rid of the local as suggested by w0uter.

_FTPput("subdomain.domain.com", @scriptdir &"\file.txt'", "username", "pass", "folder", 1)

w0uter thanks again it really helped.

##### Share on other sites

Wow! This is brilliant, I just managed to upload a wodload of txt files in a batch and no problem at all.

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

×

• Wiki

• Back

• Git

## Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.