ivan Posted December 1, 2005 Share Posted December 1, 2005 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: expandcollapse popup #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 Link to comment Share on other sites More sharing options... w0uter Posted December 1, 2005 w0uter Active Members 2.2k resreveR nA Share 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 Link to comment Share on other sites More sharing options... ivan Posted December 1, 2005 ivan Active Members 399 Author Share 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 Link to comment Share on other sites More sharing options... ivan Posted December 1, 2005 ivan Active Members 399 Author Share 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 Think out of the boxGrabber: Yet another WinInfo tool_CSVLib (still alpha)Dynamic html in au3 Link to comment Share on other sites More sharing options...
w0uter Posted December 1, 2005 Share Posted December 1, 2005 (edited) just remove the Local and yes you have the principle right. but how can you put something on an HTTP:// protocol 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 Link to comment Share on other sites More sharing options...
ivan Posted December 1, 2005 Author Share Posted December 1, 2005 Oops, that http is a copy/paste mistake. Thanks again. Think out of the boxGrabber: Yet another WinInfo tool_CSVLib (still alpha)Dynamic html in au3 Link to comment Share on other sites More sharing options...
ivan Posted December 1, 2005 Author Share Posted December 1, 2005 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. Think out of the boxGrabber: Yet another WinInfo tool_CSVLib (still alpha)Dynamic html in au3 Link to comment Share on other sites More sharing options...
ivan Posted December 1, 2005 Author Share Posted December 1, 2005 Wow! This is brilliant, I just managed to upload a wodload of txt files in a batch and no problem at all. Think out of the boxGrabber: Yet another WinInfo tool_CSVLib (still alpha)Dynamic html in au3 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now