scriptkid Posted September 6, 2007 Posted September 6, 2007 Hi everybody,I wrote a script for upload file to FTP server and i copied FTP.au3 file follow http://www.autoitscript.com/forum/index.ph...ost&id=3314 link, put that in my folder inlcudeBut it's can not connect FTP server. It's fail. Can you advise me? pls. It's inform "Connection was fail".. This is my script as below: #include <FTP.au3>$s_ServerName = 'gentleman.110mb.com'$s_Username = 'gentleman'$s_Password = '*****'$SourceFile ='D:\test.htm' ;-----Open session-------$Open = _FTPOpen("Myftp") ;------ Connect FTP server-------$ Conn = _FTPConnect(_FTPOpen(""), $s_ServerName, $s_Username, $s_Password)If $ Conn = 0 Then MsgBox(4096, "", "Connection was fail", 10) ;-------- Upload a file-----------$Ftpp = _FtpPutFile($ Conn , $SourceFile, '/test.htm')if $Ftpp = 1 then MsgBox(4096, "","Upload successed a file" );-------- Close connection---------$Ftpc = _FTPClose($Open)if $Ftpc = 1 then MsgBox(4096, "","Disconnected")
cdkid Posted September 6, 2007 Posted September 6, 2007 (edited) Hi everybody, I wrote a script for upload file to FTP server and i copied FTP.au3 file follow http://www.autoitscript.com/forum/index.ph...ost&id=3314 link, put that in my folder inlcude But it's can not connect FTP server. It's fail. Can you advise me? pls. It's inform "Connection was fail".. This is my script as below:Well, not sure if it'll make any diff but... try $Conn = _FTPConnect($open $s_ServerName, $s_Username, $s_Password) instead of $Conn = _FTPConnect(_FTPOpen(""), $s_ServerName, $s_Username, $s_Password) Also, you have a space between the $ and conn, remove that so it's like this $Conn and just to verify, you ARE using the right credentials & all that, and you know the FTP server works? ~cdkid Edited September 6, 2007 by cdkid AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!
Developers Jos Posted September 6, 2007 Developers Posted September 6, 2007 (edited) Make sure you read the part about the need to DllOpen() WinInet.dll and use the returned handle. Many times asked...many times answered so you should find a hit somewhere in the forum. Edited September 6, 2007 by JdeB 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.
scriptkid Posted September 6, 2007 Author Posted September 6, 2007 Thanks cdkid for reply, Yes, i tried as you say. $Conn = _FTPConnect(_FTPOpen(""), $s_ServerName, $s_Username, $s_Password) but it was fail. Make sure, between the $and conn does not a space. I check again already. ( if it have a space, it don't understand variable $conn) i usually check it by Totalcmd soft and i sure it's very good. i can upload/download files by totalcmd or Dos command Cdkid, i need your opinion. can you help me. Has anybody advice me? Pls.
cdkid Posted September 6, 2007 Posted September 6, 2007 Read JdeB's post, dude. Pretty sure he gave you an answer. ~cdkid AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!
scriptkid Posted September 6, 2007 Author Posted September 6, 2007 Make sure you read the part about the need to DllOpen() WinInet.dll and use the returned handle.Many times asked...many times answered so you should find a hit somewhere in the forum.Ok, i try to check again in the forum as you say.Thanks JdeB , ( but if you can post link at here, I thank verymuch, )
scriptkid Posted September 6, 2007 Author Posted September 6, 2007 OH, now it's well. Thanks all. Now, i know why it don't worked I lack $dllop=DllOpen('wininet.dll').
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