houseonfire Posted December 2, 2007 Share Posted December 2, 2007 (edited) #include <GUIConstants.au3> #Include <file.au3> #include <Word.au3> #include <Array.au3> #include <ftp.au3> I am using the most recent one. I did not change the version of the FTP, i changed my Autoit version. I thought maybe the file got some how encrypted, or compressed. It didn't. I need some one on one chat with someone who knows a lot about autoit.. Please, someone PM me and ask for my hotmail/AIM / Gmail, or something Edited December 2, 2007 by houseonfire Link to comment Share on other sites More sharing options...
Zepx Posted December 5, 2007 Share Posted December 5, 2007 (edited) Is there a function that could overwrite existing upload file? Edit: Overwrite function works automatically OnPut. No necessary function required =/. Edited December 5, 2007 by Zepx Link to comment Share on other sites More sharing options...
ficofico Posted December 5, 2007 Share Posted December 5, 2007 Hi guys, I'm trying to use this script, but I'm not good... I'm searching a way to mirroring an ftp folder with a folder in desktop pc. Only the changed or newer files have to be downloaded in the pc folder.... it's possible with this script? I've downloaded ftp.au3 and ftp example from originale source link, but I'm not able to use it, It's simple ? thanks Link to comment Share on other sites More sharing options...
Ontosy Posted December 22, 2007 Share Posted December 22, 2007 do it is possibile to use a secure ftp: ftps? Link to comment Share on other sites More sharing options...
sensalim Posted December 25, 2007 Share Posted December 25, 2007 (edited) Hi, I have the FTPOpen() to return an identifier, but I can't get the _FTPConnect() to work. My ftp is (username).freehostia.com (of course the (username) is something else I'm not telling). Password and username are correct, I could connect using ftp (start > run > cmd > ftp) So maybe freehostia doesn't work with your ftp.au3? Any alternative website? Thanks! Edit1: Zedna told me to open DLL first: $dllhandle = DLLOpen('wininet.dll') $Open = _FTPOpen(...) ... DLLClose($dllhandle) I'll try that. Thanks! Edited December 26, 2007 by sensalim Link to comment Share on other sites More sharing options...
Iuli Posted February 5, 2008 Share Posted February 5, 2008 Hi,I have the FTPOpen() to return an identifier, but I can't get the _FTPConnect() to work.My ftp is (username).freehostia.com(of course the (username) is something else I'm not telling).Password and username are correct, I could connect using ftp (start > run > cmd > ftp)So maybe freehostia doesn't work with your ftp.au3? Any alternative website?Thanks!Edit1:Zedna told me to open DLL first:$dllhandle = DLLOpen('wininet.dll')$Open = _FTPOpen(...)...DLLClose($dllhandle)I'll try that. Thanks!The same here. _FTPPutFile returns 0. [size="2"]SFXMaker[/size] - The most complete switchless installer creator software[indent][/indent] Link to comment Share on other sites More sharing options...
gertsolo Posted February 18, 2008 Share Posted February 18, 2008 I probably overlooked it, but isn't there a ftpGet function? The more you learn, the less you know. Link to comment Share on other sites More sharing options...
MetalSpongebob Posted March 5, 2008 Share Posted March 5, 2008 I got these error using the base-script of Zedna C:\Programs\AutoIt3\Include\ftp.au3(90,91) : ERROR: _FtpPutFile() called by a previous line with 2 arg(s). Min = 3. First previous line calling this Func is 8. Func _FTPPutFile($l_FTPSession, $s_LocalFile, $s_RemoteFile, $l_Flags = 0, $l_Context = 0) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\ftpScript.au3(20,41) : ERROR: _FtpPutFile() called with wrong number of args. $Ftpp = _FtpPutFile($Conn, 'c:\file.txt') ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Programs\AutoIt3\Include\ftp.au3(90,91) : REF: definition of _FtpPutFile(). Func _FTPPutFile($l_FTPSession, $s_LocalFile, $s_RemoteFile, $l_Flags = 0, $l_Context = 0) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\ftpScript.au3 - 2 error(s), 0 warning(s) Noob but ethical Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 5, 2008 Moderators Share Posted March 5, 2008 I got these error using the base-script of Zedna C:\Programs\AutoIt3\Include\ftp.au3(90,91) : ERROR: _FtpPutFile() called by a previous line with 2 arg(s). Min = 3. First previous line calling this Func is 8. Func _FTPPutFile($l_FTPSession, $s_LocalFile, $s_RemoteFile, $l_Flags = 0, $l_Context = 0) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\ftpScript.au3(20,41) : ERROR: _FtpPutFile() called with wrong number of args. $Ftpp = _FtpPutFile($Conn, 'c:\file.txt') ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Programs\AutoIt3\Include\ftp.au3(90,91) : REF: definition of _FtpPutFile(). Func _FTPPutFile($l_FTPSession, $s_LocalFile, $s_RemoteFile, $l_Flags = 0, $l_Context = 0) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\ftpScript.au3 - 2 error(s), 0 warning(s)It's telling you what the erros are... You're trying to call the functions without parameters. You need to fix that on your end. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
PeterJcript Posted March 24, 2008 Share Posted March 24, 2008 Do anyone use Func _FTPGetFolderContents($s_Server, $s_UserName, $s_Password, $s_RemoteDir, $s_LocalDir, ByRef $i_Count) Authored by Walkabout (2006-10-18)? An error always occurs when I get a large folder from FTP server, specially larger than 300MB . The problem I check is that the Func _FTPConnect($$) can not work well , Is there anything I can do ? Any feedback will be really appreciated. Link to comment Share on other sites More sharing options...
Mattraks Posted April 5, 2008 Share Posted April 5, 2008 Do i put it in the includes folder and just include it in my script? Also, i tried it and nothing happened. I looked in the folders and couldnt find Exaple.exe Link to comment Share on other sites More sharing options...
Zedna Posted April 23, 2008 Share Posted April 23, 2008 (edited) I'm using this script, and the _FTPConnect() function always returns 0. _FTPOpen return 13369348 so the problem is with the _FTPConnect() function.Look hereI recommend you to read all posts in this FTP UDF topic Edited April 23, 2008 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
CyRius Posted April 23, 2008 Share Posted April 23, 2008 (edited) #include <FTP.au3> $server = 'XX.XX.XXX.XX' $username = '*******' $pass = '**********' $dllhandle = DllOpen('wininet.dll') $Open = _FTPOpen('FTP-CyRius') $Conn = _FTPConnect($Open, $server, $username, $pass) MsgBox(0,"",$Conn) $Ftpp = _FtpPutFile($Conn,'file.ini') If @error Then MsgBox(0, "Error", @error) EndIf $Ftpc = _FTPClose($Open) DllClose($dllhandle) _FTPOpen() returns 13369348 and _FTPConnect() returns 0. Host, username, password are correct. What's the problem? I didn't find any resolvation about this bugs:-?? I already read 200 posts. I have Windows XP SP2. Edited April 23, 2008 by CyRius [font="Courier New"][size="3"]CyRius Developments[/size][/font][list][*]CO Proxy[*]CO Assembly tool[*]CO PacketSniffer[*]Larkinor proxy[*]BoIM Messenger[*]Encrypt/Decrypt[*]Hashtables[*]Slowest, but greatest skins ever xD[/list] Link to comment Share on other sites More sharing options...
webjocky Posted May 6, 2008 Share Posted May 6, 2008 (edited) I've spent hours on this trying to get it to work, but when I run my compiled script - absolutely nothing happens. Yes, I've read every single post in this thread. I hope someone can point out an obvious ID-10-T error of some sort. Here's my function: expandcollapse popup#include <FTP.au3> #include <File.au3> Global $server = "mydomain.com" Global $username = "myusername" Global $pass = "mypassword" Update() Func Update() $BackupReporterExists = FileExists("BackupReporter.exe") $ConfigExists = FileExists("config.exe") $UpdateExists = FileExists("update.exe") $VersionLogsExists = FileExists("currentversion.log") If $BackupReporterExists Then ;;;;;;;;;;;; I even tried to debug using this msgbox to ensure the script was making it into this If-Then statement... it does! ;;;;;;;;;;;;;;;;;;; MsgBox(0, "Hey!", "Backup Reporter Exists") ;;;;;;;;;;;; I included some error handling in the first upload attempt so at least I should get a msgbox if something goes wrong, but nothing ever pops up ;;;;;;;;;;;;;;;;;;;; $Open = _FTPOpen ('FTP') If @error Then MsgBox(0, "", "fail_open") Exit EndIf $Conn = _FTPConnect ($Open, $server, $username, $pass) If @error Then MsgBox(0, "", "fail_Conn") Exit EndIf $Ftpp = _FtpPutFile ($Conn, 'BackupReporter.exe', 'BackupReporter.exe') If @error Then MsgBox(0, "", "fail_PutFile") Exit EndIf $Ftpc = _FTPClose ($Open) If @error Then MsgBox(0, "", "fail_close") Exit EndIf Else MsgBox(0, "Error", "BackupReporter.exe not found") EndIf If $ConfigExists Then $Open = _FTPOpen ('FTP') $Conn = _FTPConnect ($Open, $server, $username, $pass) $Ftpp = _FtpPutFile ($Conn, 'config.exe', 'config.exe') $Ftpc = _FTPClose ($Open) Else MsgBox(0, "Error", "config.exe not found") EndIf If $UpdateExists Then MsgBox(0, "File Exists", "Updater") $Open = _FTPOpen ('FTP') $Conn = _FTPConnect ($Open, $server, $username, $pass) $Ftpp = _FtpPutFile ($Conn, 'update.exe', 'update.exe') $Ftpc = _FTPClose ($Open) Else MsgBox(0, "Error", "update.exe not found") EndIf If $VersionLogsExists Then MsgBox(0, "File Exists", "Version Log") $Open = _FTPOpen ('FTP') $Conn = _FTPConnect ($Open, $server, $username, $pass) $Ftpp = _FtpPutFile ($Conn, 'currentversion.log', 'currentversion.log') $Ftpc = _FTPClose ($Open) Else MsgBox(0, "Error", "currentversion.log not found") EndIf EndFunc ;==>Update ANY help would be greatly appreciated. Edit: It just occurred to me that the path to the files to be uploaded might HAVE to be a full path, even though the files themselves are in the same directory as the script... I'm going to test and return with results. Edit.2: File path had nothing to do with it. You have to call the dll manually before the script can take advantage of it. DOH! I got my answer from the post above, quoted below: Look here I recommend you to read all posts in this FTP UDF topic Zedna rocks. Edited May 6, 2008 by webjocky The tiniest of things can ruin your day, or brighten your afternoon. Read it once, read it again, and pay attention. Then search the forums. If all else fails, ask somebody else. Link to comment Share on other sites More sharing options...
therms Posted May 12, 2008 Share Posted May 12, 2008 I'm a little clueless on how to use _FtpCommand to chmod a file. I can get the file uploaded just fine, but changing it's attributes once there is beyond my reach. Any suggestions? $dllhandle = DllOpen('wininet.dll') Dim Const $FtpUser="xxx" Dim Const $FtpPass="xxx" Dim Const $FtpServer="xxx" Dim Const $file1='test.txt' Dim Const $file2='test.txt' $Open= _FTPOpen('ftpcontrol') $Conn = _FTPConnect($Open, $FtpServer, $FtpUser, $FtpPass) PutIt($file1, $file2) $ftpc = _FTPClose($Open) DllClose($dllhandle) Func PutIt($filesrc, $filedst) $Ftpp = _FtpPutFile($Conn, $filesrc, $filedst) $Ftpcmd = _FtpCommand('ftpcontrol', 'chmod +x' & $filedst) EndFunc Link to comment Share on other sites More sharing options...
rudolph Posted May 14, 2008 Share Posted May 14, 2008 Hi all:I am using UDF FTP.au3, to upload a text file from windows Xp sp2 to unix ftp server,the scrip is running well but I found a BIG PROBLEM, maybe a BUG in FTP.au3 when the file test.txt is uploaded, the file was changed and added a carriage return(CR) and a line feed (LF) for ,for each line . Someone can tell me what is wrong with my script or is a FTP.au3 BUG?Please I need a HELP on this ?CR=carriage return LF=Line feedFor example , original file test.txt looks like this:aaaaaaaaaaaaabbbbbbbbb123456CRbbbbbbbbbbbbbbbbbbbbbbbbbbbbCRddddddddddddddddddddddddddddCRThe new uploaded file test.txt looks like this (Inserted CR and LF for each line):aaaaaaaaaaaaabbbbbbbbbccccccCRCRLFbbbbbbbbbbbbbbbbbbbbbbbbbbbbCRCRLFddddddddddddddddddddddddddddCRCODEOpt ("ExpandEnvStrings", 0)Opt ("ExpandVarStrings", 1)Opt ("MustDeclareVars", 1);;#include <GUIConstants.au3>#include <FTP.au3>Dim $server = "ftp.test.com"Dim $username = "usr"Dim $pass = "passw"Dim $port = 21Dim $dllhandle = DllOpen('wininet.dll')Dim $Open = _FTPOpen('MyFTP')if @error Then MsgBox(0, "", "fail_open") ExitEndIfDim $Conn = _FTPConnect($Open, $server, $username, $pass, $port)If @error Then MsgBox(0, "", "fail_Connect") ExitEndIfDim $Ftpp = _FtpPutFile($Conn, 'C:\TEMP\test.txt', '/test.txt')If @error Then MsgBox(0, "", "fail_PutFile") ExitEndIfDim $Ftpc = _FTPClose($Open)If @error Then MsgBox(0, "", "fail_Close") ExitEndIfDllClose($dllhandle)MsgBox(0,"FTP PUT File - Status ", ""$Ftpc = " & $Ftpc" & "$Open = " & $Open & @CRLF & "$Conn = " & $Conn & @CRLF & "$Ftpp = " & $Ftpp & @CRLF & "$Ftpc = " & $Ftpc )Exit Link to comment Share on other sites More sharing options...
isno Posted June 4, 2008 Share Posted June 4, 2008 hello, sory for my english ( I'am french ) I have a problem with the fonction _FTPGetFoldercontents it get correctly the files and folders in level 1 but not the files and folders in level 2 ,3 .... can you help me? Link to comment Share on other sites More sharing options...
djpyne Posted June 6, 2008 Share Posted June 6, 2008 Hi all this is my first post in here so I hope I am doing this correctly. I needed a way to pull a file from an ftps server so I added a function to the ftp.au3 file _FTPGetFile I just reversed some of the _FTPPutFile. Function I added to FTP.au3 is below. Func _FTPGetFile($l_FTPSession, $s_RemoteFile, $s_LocalFile, $l_Flags = 0, $l_Context = 0) Local $ai_FTPGetFile = DllCall('wininet.dll', 'int', 'FtpGetFile', 'long', $l_FTPSession, 'str', $s_RemoteFile, 'str', $s_LocalFile, 'long', $l_Flags, 'long', $l_Context) If @error OR $ai_FTPGetFile[0] = 0 Then SetError(-1) Return 0 EndIf Return $ai_FTPGetFile[0] EndFunc;==> _FTPPutFile() Then I do this call in my script that I run: $Ftpp = _FtpGetFile($Conn, "/version.txt", "C:\version.txt") When I run this in version 3.2.10.0 it crashes when it runs the above function. If I run it in v3.1.1.0 it works great. Anybody know why or show mw what I am doing wrong? Thanks. Link to comment Share on other sites More sharing options...
djpyne Posted June 6, 2008 Share Posted June 6, 2008 Nevermind I found an ftp_v3.au3 and this seems to have fixed the issue. Link to comment Share on other sites More sharing options...
martin Posted June 6, 2008 Share Posted June 6, 2008 hello,sory for my english ( I'am french )I have a problem with the fonction _FTPGetFoldercontentsit get correctly the files and folders in level 1but not the files and folders in level 2 ,3 ....can you help me?I'm not familiar with that function, but if _FTPGetFoldercontents is using 'FtpFindFirstFile' and 'InternetFindNextFile' then data is loaded into a $WIN32_FIND_DATA structure. The first element of that structure will be 16 if the name is a folder. You would then need to list the files in that folder as well. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. 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