Sign in to follow this  
Followers 0
itsnotluketime

FTP creating and reading files help

6 posts in this topic

the help file does not explain very clearly how the FTP commands work. I have a FTP server on the website "lukeisreallycool.tk" but i cant seem to get any of the FTP commands to work with my website :(. please help me!

Share this post


Link to post
Share on other sites



Code is a helpful thing.

Share this post


Link to post
Share on other sites
#include <FTPEx.au3>
Local $sServer = 'ftp.lukeisreallycool.tk'
Local $sUsername = 'username'
Local $sPass = 'password'
Local $sRemote = InputBox ("file", "what file would you like to create?")

Local $hOpen = _FTP_Open('MyFTP Control')
Local $hConn = _FTP_Connect($hOpen, $sServer, $sUsername, $sPass)
sleep(5000)
;FTP connected at this point

_FTP_DirCreate ( $hConn, $sRemote )

Local $iFtpc = _FTP_Close($hConn)
Local $iFtpo = _FTP_Close($hOpen)

that's all I have so far, its composed from the help file mostly as I have no clue what I'm doing. If I run the script it goes all the way through with no errors but does not create any new dir's on my ftp website ;_;

Share this post


Link to post
Share on other sites

oh ok nevermind Its working now, YES! i guess i was just typing my password in wrong the whole time xD. sorry for wasting your guys time.

Share this post


Link to post
Share on other sites

And that's why you always look at returns and @error :)

Share this post


Link to post
Share on other sites

well I have encountered yet another problem...

I'm trying to read a file in my FTP server and it keeps returning gibberish, like 0xA7SAD5HSE4. How do i make it return text? heres the code:

#include <Array.au3>
#include <FTPEx.au3>


    Local $open = _FTP_Open("FTPtest")
    Local $connect = _FTP_Connect($open, 'ftp.lukeisreallycool.tk', 'username', 'password')
    _ftp_dirsetcurrent($connect,"/")
    Local $ftpfile = '/alpha.txt'
    $ftpopen = _FTP_FileOpen($connect, $ftpfile)
    MsgBox(1, "test", _FTP_FileRead( $ftpopen, 40))

I have no idea what I'm doing wrong O_O

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