Jump to content

Little help with FTP.au3


ivan
 Share

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

        
    

        
    

    

    




    Link to comment
    
        
    
    
    

    
    Share on other sites
    

    
        
            

    

        
            

    

        
            

    

        
            

    

        
    


    
    More sharing options...

    


    

                    
                    
                    
                

                    

                    
                    





    

    

    
        
            
                


    
        
    

                
                
                    
                        

                    
                
            
        
        
            
                


w0uter
            
            
                Posted 
                
            
        
    
    
        


w0uter
            
        
        
            
                
                    


    
        
    

                    
                    
                        

                    
                
            
            
                Active Members
                
            
            
                
                    
                        
                            
                                
                            
                                 2.2k
                            
                                
                            
                        
                        
                    
                
            
            
                

    
    
        
 resreveR nA
    
    

            
        
    
    
        



    
        
            
                
                    
                    
                    
                    
                    
                
            
            
                
                    
                    
                        
                        
                            Share
                        
                        
                        
                        
                        
                            
                                
                            
                            
                            
                            
                            
                            
                        
                    
                
                
            
        

        
            Posted 
            
            
                
                    (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  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 
                
            
        
    
    
        


ivan
            
        
        
            
                
                    


    
        
    

                    
                    
                        

                    
                
            
            
                Active Members
                
            
            
                
                    
                        
                            
                                
                            
                                 399
                            
                                
                            
                        
                        
                    
                
            
            
                

            
        
    
    
        



    
        
            
                
                    
                        Author
                    
                    
                    
                    
                    
                
            
            
                
                    
                    
                        
                        
                            Share
                        
                        
                        
                        
                        
                            
                                
                            
                            
                            
                            
                            
                            
                        
                    
                
                
            
        

        
            Posted 
            
            
                
                
            
        
    

    

    

    
        
        
            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 
                
            
        
    
    
        


ivan
            
        
        
            
                
                    


    
        
    

                    
                    
                        

                    
                
            
            
                Active Members
                
            
            
                
                    
                        
                            
                                
                            
                                 399
                            
                                
                            
                        
                        
                    
                
            
            
                

            
        
    
    
        



    
        
            
                
                    
                        Author
                    
                    
                    
                    
                    
                
            
            
                
                    
                    
                        
                        
                            Share
                        
                        
                        
                        
                        
                            
                                
                            
                            
                            
                            
                            
                            
                        
                    
                
                
            
        

        
            Posted 
            
            
                
                
            
        
    

    

    

    
        
        
            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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...