obscurant1st Posted March 25, 2009 Share Posted March 25, 2009 I have coded a script for ftp downloader. but it is not working.some error comes up.. can anybody please help me??? I've attached the files. 1. ftp.au3 - to be included in my script. 2. ftp downloader.au3 - my script.ftp_downloader.au3ftp.au3 [u]We don't need people who can spit back facts. We've got Google."[/u] WebguruBB - Free Hosting, Domains, and SEO articles.Awesome Techs - Tips, Tricks and Some Technology NewsCool Facts - Cool Facts, Fun Facts, Weird Facts etc. Link to comment Share on other sites More sharing options...
BrettF Posted March 25, 2009 Share Posted March 25, 2009 Please Read the helpfile. They way you are handling events is wrong. expandcollapse popup#include <GUIConstants.au3> #include <Array.au3> ;#include "ftp.au3" $Form1 = GUICreate("FTP Vundo/Monder Downloader", 306, 235, 195, 113) $server = GUICtrlCreateInput("<server name>", 24, 32, 257, 21) $username = GUICtrlCreateInput("<user name>", 136, 88, 137, 21) $pass = GUICtrlCreateInput("<password>", 136, 120, 137, 21) $Label1 = GUICtrlCreateLabel("Server Name/Address:", 24, 16, 132, 17) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") $Label2 = GUICtrlCreateLabel("Username:", 64, 90, 64, 17) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") $Label3 = GUICtrlCreateLabel("Password:", 64, 123, 62, 17) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") $Connect = GUICtrlCreateButton("Connect", 112, 184, 75, 25, 0) GUISetState(@SW_SHOW) $dllhandle = DllOpen('wininet.dll') While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE DllClose($dllhandle) Exit Case $Connect FTPConnection() EndSwitch WEnd Func FTPConnection() $Open = _FTPOpen('Connect to Server') $Conn = _FTPConnect($Open, $server, $username, $pass) $threatDir = InputBox("Threat Remote Dir", "Enter the Remote Threat Dir:") $localDir = InputBox("Local Dir", "Enter the local Path:") _FtpSetCurrentDir($Conn, $threatDir) Dim $file, $l_Context $temp = _FTPFileFindFirst($Conn, $threatDir) _ArrayDisplay($temp) $file = $temp[10] While 1 _FTPGetFile($Conn, $threatDir & "/" & $file, $localDir & "\" & $file, 2, 0, 0x00000080, 0) $file = _FTPFileFindNext($dllhandle, $l_Context) If @error Then MsgBox(0, "Done!!!", "no More Files to Download") _FTPFileFindClose($Conn, $threatDir) Exit EndIf WEnd $Ftpc = _FTPClose($Open) EndFunc ;==>FTPConnection ;/Public/AutoItScript Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
obscurant1st Posted March 26, 2009 Author Share Posted March 26, 2009 ok.. but for me error comes when i run the script.. the line in which error comes is $temp = _FTPFileFindFirst($Conn, $threatDir) it saying like array size exceeded .. but how can it be possible since it have only 12 rows and i'm declaring it as temp[12] [u]We don't need people who can spit back facts. We've got Google."[/u] WebguruBB - Free Hosting, Domains, and SEO articles.Awesome Techs - Tips, Tricks and Some Technology NewsCool Facts - Cool Facts, Fun Facts, Weird Facts etc. Link to comment Share on other sites More sharing options...
BrettF Posted March 26, 2009 Share Posted March 26, 2009 (edited) My code snippet shows it as [10]. are you sure you've updated it? I'm not sure, but if the array starts at 1, then you will need ad one to the rows (i.e. [13])I will come back to you on it, let me just have a look...Cheers,Brett Edited March 26, 2009 by BrettF Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
BrettF Posted March 26, 2009 Share Posted March 26, 2009 I see your using this:http://www.autoit.de/index.php?page=Thread&postID=48393I still cannot work out why it is not working like it should. All it returns is "." for a filename!Maybe ProgAndy will join the topic and tell us whats wrong #include "ftp.au3" ;REMBER TO USE GUICTRLREAD TO GET THE VALUES OF $SERVER, $USERNAME AND $PASS! $serv = "" $user = "" $pass = "" $hndl = "" $struct = "" $FTP = _FTPOpen("AutoIt v3") $FTPServer = _FTPConnect($FTP, $serv, $user, $pass, 1) $threatDir = "/" $localDir = "C:\Test\" _FtpSetCurrentDir($FTPServer, $threatDir) Dim $file, $l_Context $temp = _FTPFileFindFirst($FTPServer, $threatDir, $hndl, $struct, 0, 0) If IsArray($temp) Then While 1 $filename = $temp[10] MsgBox(0, "", $filename) If $filename <> "." Then MsgBox(0, "", $filename) _FTPGetFile($FTPServer, $threatDir & $filename, $localDir & "\" & $file, 2, 0, 0x00000080, 0) $temp = _FTPFileFindNext($hndl, $struct) If @error Then MsgBox(0, "Done!!!", "no More Files to Download") _FTPFileFindClose($FTPServer, $threatDir) ExitLoop EndIf EndIf WEnd EndIf $Ftpc = _FTPClose($FTP) Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
obscurant1st Posted March 26, 2009 Author Share Posted March 26, 2009 yeah hope so... n thank yuou very much for trying to help me.. [u]We don't need people who can spit back facts. We've got Google."[/u] WebguruBB - Free Hosting, Domains, and SEO articles.Awesome Techs - Tips, Tricks and Some Technology NewsCool Facts - Cool Facts, Fun Facts, Weird Facts etc. Link to comment Share on other sites More sharing options...
obscurant1st Posted March 31, 2009 Author Share Posted March 31, 2009 (edited) m8, i did it..thnk u..bt still got some issues..!!!the link to my script is http://www.autoitscript.com/forum/index.ph...mp;#entry663431pls help me on this also. Edited March 31, 2009 by obscurant1st [u]We don't need people who can spit back facts. We've got Google."[/u] WebguruBB - Free Hosting, Domains, and SEO articles.Awesome Techs - Tips, Tricks and Some Technology NewsCool Facts - Cool Facts, Fun Facts, Weird Facts etc. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now