Hi,
I want a combo box to display a list of directories from an ftp in a combo box and found this in the help file 'FUNCTION _FTP_ListToArray' which gives the example...
#include <FTPEx.au3>
Local $server = 'ftp.csx.cam.ac.uk'
Local $username = ''
Local $pass = ''
Local $Open = _FTP_Open('MyFTP Control')
Local $Conn = _FTP_Connect($Open, $server, $username, $pass)
Local $aFile = _FTP_ListToArray($Conn, 2)
ConsoleWrite('$NbFound = ' & $aFile[0] & ' -> Error code: ' & @error & @CRLF)
ConsoleWrite('$Filename = ' & $aFile[1] & @CRLF)
Local $Ftpc = _FTP_Close($Open)
My questions are, do i need to create a new ftp user as the app will be for the public? and will the user details be able to access all folders on the server? because i obviously dont want people being able to browse folders which contain other peoples websites hosted on the server.
I was thinking something like this...
#include <FTPEx.au3>
#NoTrayIcon
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
$MAIN = GUICreate("main", 400, 400, -1, -1)
GUISetState(@SW_SHOW)
Local $server = 'my server ip'
Local $username = 'publicusername'
Local $pass = 'publicpassword'
Local $Open = _FTP_Open('is this the name of the base folder??')
Local $Conn = _FTP_Connect($Open, $server, $username, $pass)
Local $aFile = _FTP_ListToArray($Conn, 1)
$COMBO = GUICtrlCreateCombo("", 150, 136, 177, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GuiCtrlSetData($COMBO, "|" &_ArrayToString($aFile, "|", 1))
Local $Ftpc = _FTP_Close($Open)
While 1
Sleep(0)
WEnd
is this correct, and would this be secure?
thanks