Jump to content

FTP works, up until...


Recommended Posts

Hi guys, the script does upload the text file, but it will not read it in msgbox? 

I don't see why, and I've been trying... any idea why?

 

#RequireAdmin
#include <FTP.au3>
#include <FTPEx.au3>
$server = "ftp.stole--private"
$username = "--private"
$pass = "--private"

$Open = _FTPOpen("--private")
consolewrite( "Open: " & $Open & @crlf )
$Conn = _FTPConnect($Open, $server, $username, $pass)
consolewrite( "Connect: " & $Conn & @crlf )
;we are connected.

$Ftpp = _FtpPutFile($Conn, @ScriptDir&"\TotalPurchases.txt", "TotalPurchases.txt")
consolewrite( "Put Result: " & $Ftpp & @crlf )

; reading it
 (this is where it stops working and returns blank.)
   $ftpfileopen = _FTP_FileOpen($Conn,"\TotalPurchases.txt")
  Local $ftpfile = _FTP_FileRead($ftpfileopen,100000)
Global $convertstring = BinaryToString($ftpfile)
msgbox(1,"read",$convertstring)
$Ftpc = _FTPClose($Open)

 

Edited by Hospital
Link to comment
Share on other sites

This works for me:

#include <FTPEx.au3>
$server = "127.0.0.1"
$username = "Bert"
$pass = "Test"

$Open = _FTP_Open("--private")
consolewrite( "Open: " & $Open & @crlf )
$Conn = _FTP_Connect($Open, $server, $username, $pass)
consolewrite( "Connect: " & $Conn & @crlf )
;we are connected.

$Ftpp = _FTP_FilePut($Conn, @ScriptDir&"\FTP_FileRead.au3", "FTP_FileRead.au3")
consolewrite( "Put Result: " & $Ftpp & @crlf )

; reading it(this is where it stops working and returns blank.)
   $ftpfileopen = _FTP_FileOpen($Conn,"\FTP_FileRead.au3")
  Local $ftpfile = _FTP_FileRead($ftpfileopen,100000)
Global $convertstring = BinaryToString($ftpfile)
msgbox(1,"read",$convertstring)
_FTP_Close($Conn)
_FTP_Close($Open)

 

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