Jump to content

Issue With FTP_FilePut


Go to solution Solved by nofire,

Recommended Posts

Hi Just wondering if someone could help me with this.

My code is designed so that each machine at my workplace (Multiple Sites/VPNs/External IPs uploads a blank ftp file everytime they log in with a random number appended (a stupid request from my manager)

Func NotifyServer()
    $ip = _GetIP()
    Local $server = 'x.x.x.x' ; Obviously Real IP of Server
    Local $username = 'files'
    Local $pass = 'files'
    FileOpen(@DocumentsCommonDir & "\admin\" & $ip & ".txt", 2)
    Local $Open = _FTP_Open('MyFTP Control')
    Local $Conn = _FTP_Connect($Open, $server, $username, $pass)
    _FTP_FilePut($Conn, @DocumentsCommonDir & "\admin\" & $ip & ".txt", $ip & Random(000, 999, 1) & ".txt")
    Local $Ftpc = _FTP_Close($Open)
EndFunc

Everything works fine with logging in but _FTP_FilePut does not upload the files. here is the log from my ftp server

(000058)12/14/2013 10:08:53 AM - (not logged in) (x.x.x.x)> Connected, sending welcome message...
(000058)12/14/2013 10:08:53 AM - (not logged in) (x.x.x.x)> 220-FileZilla Server version 0.9.41 beta
(000058)12/14/2013 10:08:53 AM - (not logged in) (x.x.x.x)> 220-written by Tim Kosse (Tim.Kosse@gmx.de)
(000058)12/14/2013 10:08:53 AM - (not logged in) (x.x.x.x)> 220 Please visit http://sourceforge.net/projects/filezilla/
(000058)12/14/2013 10:08:53 AM - (not logged in) (x.x.x.x)> USER files
(000058)12/14/2013 10:08:53 AM - (not logged in) (x.x.x.x)> 331 Password required for files
(000058)12/14/2013 10:08:53 AM - (not logged in) (x.x.x.x)> PASS *****
(000058)12/14/2013 10:08:53 AM - files (x.x.x.x)> 230 Logged on
(000058)12/14/2013 10:08:53 AM - files (x.x.x.x)> disconnected.

It shows that it doesnt even try to upload the file, anyone come across this before or am I just missing something really obvious

Thanks for any help

[font="'courier new', courier, monospace;"]Pastebin UDF | Prowl UDF[/font]

Link to comment
Share on other sites

Hi mrflibblehat,

  just a suggestion...try to put a sleep before the FTP close to test that the script is not closing the connection during/before the transfer.

Bill

 

Good Thinking but it still doesnt work. Now the server just shows thats its logged on and waits, but nothing happens.

(000059)12/14/2013 14:14:47 PM - (not logged in) (x.x.x.x)> Connected, sending welcome message...
(000059)12/14/2013 14:14:47 PM - (not logged in) (x.x.x.x)> 220-FileZilla Server version 0.9.41 beta
(000059)12/14/2013 14:14:47 PM - (not logged in) (x.x.x.x)> 220-written by Tim Kosse (Tim.Kosse@gmx.de)
(000059)12/14/2013 14:14:47 PM - (not logged in) (x.x.x.x)> 220 Please visit http://sourceforge.net/projects/filezilla/
(000059)12/14/2013 14:14:47 PM - (not logged in) (x.x.x.x)> USER files
(000059)12/14/2013 14:14:47 PM - (not logged in) (x.x.x.x)> 331 Password required for files
(000059)12/14/2013 14:14:47 PM - (not logged in) (x.x.x.x)> PASS *****
(000059)12/14/2013 14:14:47 PM - files (x.x.x.x)> 230 Logged on
(000059)12/14/2013 14:14:57 PM - files (x.x.x.x)> disconnected.

Its almost as if its waiting for something to happen but nothing does.

[font="'courier new', courier, monospace;"]Pastebin UDF | Prowl UDF[/font]

Link to comment
Share on other sites

Next thing I would try is simplifying the path, use the actual path to an actual file and then start changing back to your original code one piece at time until you find the culprit.

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