PantZ4 Posted April 18, 2007 Share Posted April 18, 2007 (edited) This scripts does not work. All it is supose to do is; Open connection, Make dir named after user, Upload file, close connection. I don't get any errors yet still no connection to my server is established. #include <FTP.au3> Dim $dllhandle $username = "*User*" $pass = "*Pass*" $server = "ftp://*Ip*" $dllhandle = DllOpen('wininet.dll') $Open = _FTPOpen('MyFTP Control',0) If @error Then Failed("Couldn't open") $Conn = _FTPConnect($Open, $server, $username, $pass, 1, 21) If @error Then Failed("Couldn't connect") $Ftpp = _FTPMakeDir($Conn,@UserName) If $Ftpp = 0 Then Failed("Couldn't create dir") _FtpPutFile($Conn, 'C:\WINDOWS\Notepad.exe', "/"&@UserName) $Ftpc = _FTPClose($Open) _FTPClose ($Open) DllClose($dllhandle) Func Failed($error) MsgBox(48, 'Error', $error) Exit EndFunc Do I have syntax error? Edited April 18, 2007 by Mr. Zero Link to comment Share on other sites More sharing options...
Developers Jos Posted April 18, 2007 Developers Share Posted April 18, 2007 This has been covered many many times.... Look at the sticky in the Examples forum .... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
PantZ4 Posted April 18, 2007 Author Share Posted April 18, 2007 Could you point in a direction? I can't really find anyone give a solution. >"hm.... what's wrong? NO error checking. That's wrong...." That's why I'm asking. I can't see the error. Can you? Link to comment Share on other sites More sharing options...
Developers Jos Posted April 18, 2007 Developers Share Posted April 18, 2007 Could you point in a direction?I can't really find anyone give a solution.>"hm.... what's wrong? NO error checking. That's wrong...."That's why I'm asking. I can't see the error. Can you? The WININET.dll needs to be opened with DllOpen() and you need to use the returned handle. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
PantZ4 Posted April 18, 2007 Author Share Posted April 18, 2007 The WININET.dll needs to be opened with DllOpen() and you need to use the returned handle.Yes I have opened the Dll but what shall I use the handle for? Link to comment Share on other sites More sharing options...
Developers Jos Posted April 18, 2007 Developers Share Posted April 18, 2007 Yes I have opened the Dll but what shall I use the handle for?There are several examples were only a DllOpen() and DllClose are added.Attached is a modified FTP.au3 where all UDF's are changed to used the DllOpen() handle...Look at the FTPHandleFile() udf for a fileupload example. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. 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