Jump to content

_FTP_FilePut not working on x64


Recommended Posts

can someone help with this snippet please..

func upload()
    $newsettingsfile = _Crypt_EncryptData($settingsfile, "encrypt", $CALG_RC4)
    $uploadfile = FileOpen(@TempDir&"\settings.txt", 2)
    FileWrite(@TempDir&"\settings.txt", $newsettingsfile)
    FileClose($uploadfile)


    $server = 'xxxxxx'
    $username = xxxxxx'
    $pass = 'xxxxxx'

    $Open = _FTP_Open('File Upload')
    $Conn = _FTP_Connect($Open, $server, $username, $pass)
    _FTP_FileRename($Conn, "settings.txt", "settings-"&@YEAR&"-"&@MON&"-"&@MDAY&"--"&@HOUR&"-"&@MIN&"-"&@SEC&".txt")
    _FTP_FilePut($Conn, @TempDir&"\settings.txt", "settings.txt")
    _FTP_Close($Open)
    FileDelete(@TempDir&"\settings.txt")
EndFunc

when function is called, everything works fine on windows xp and windows 7.. however when run under windows 7 x64 it renames the existing file on the server and settings.txt is created but it's always a 0 byte file with nothing in it.

I've tried eliminating the @TempDir in the _ftp_fileput line by testing with 'c:\temp\settings.txt' but same problem, 0 byte file..

I'd rather try and do this without including a 3rd party ftp utility.. tried searching but getting nowhere.

TIA :)

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