masvil Posted January 17, 2006 Share Posted January 17, 2006 its pretty much on hold untill i know i will pass school Take your time. Thanx for effort Link to comment Share on other sites More sharing options...
masvil Posted January 18, 2006 Share Posted January 18, 2006 It seems to me there is a typing error in line 144 of ftp.au3 ("The file name to be deleted."). Anyways _FTPMakeDir is not clear for me (where have I to put the path in which new dir will be created?), so I still can' use it. Link to comment Share on other sites More sharing options...
w0uter Posted January 18, 2006 Author Share Posted January 18, 2006 It seems to me there is a typing error in line 144 of ftp.au3 ("The file name to be deleted.").Anyways _FTPMakeDir is not clear for me (where have I to put the path in which new dir will be created?), so I still can' use it.thanks, its should be "The remote directory to be created." My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
Swimming_Bird Posted January 20, 2006 Share Posted January 20, 2006 its pretty much on hold untill i know i will pass school i know the feeling man last semmester almost killed me. Link to comment Share on other sites More sharing options...
BabyBeast Posted January 20, 2006 Share Posted January 20, 2006 (edited) Your FTP function is really nice and i Just want to add 2 more Function to it expandcollapse popup;=============================================================================== ; ; Function Name: _FTPGetCurrentDir() ; Description: Get Current Directory on an FTP server. ; Parameter(s): $l_FTPSession - The Long from _FTPConnect() ; Requirement(s): DllCall, wininet.dll ; Return Value(s): On Success - Directory Name ; On Failure - 0 ; Author(s): Beast ; ;=============================================================================== Func _FTPGetCurrentDir($l_FTPSession) Local $ai_FTPGetCurrentDir = DllCall('wininet.dll', 'int', 'FtpGetCurrentDirectory', 'long', $l_FTPSession, 'str', "", 'long_ptr', 260) If @error OR $ai_FTPGetCurrentDir[0] = 0 Then SetError(-1) Return 0 EndIf Return $ai_FTPGetCurrentDir[2] EndFunc;==> _FTPGetCurrentDir() ;=============================================================================== ; ; Function Name: _FtpSetCurrentDir() ; Description: Set Current Directory on an FTP server. ; Parameter(s): $l_FTPSession - The Long from _FTPConnect() ; $s_Remote - The Directory to be set. ; Requirement(s): DllCall, wininet.dll ; Return Value(s): On Success - 1 ; On Failure - 0 ; Author(s): Beast ; ;=============================================================================== Func _FtpSetCurrentDir($l_FTPSession, $s_Remote) Local $ai_FTPSetCurrentDir = DllCall('wininet.dll', 'int', 'FtpSetCurrentDirectory', 'long', $l_FTPSession, 'str', $s_Remote) If @error OR $ai_FTPSetCurrentDir[0] = 0 Then SetError(-1) Return 0 EndIf Return $ai_FTPSetCurrentDir[0] EndFunc;==> _FtpSetCurrentDir() Those code have been tested and will work. Have fun. Note: With this the FTP function is complete and will help alot especially when you want to know which directory you are in and if you are not in that directory just get out or get in to the next one Edited January 20, 2006 by BabyBeast Link to comment Share on other sites More sharing options...
BabyBeast Posted January 20, 2006 Share Posted January 20, 2006 Btw here is a simple example $Open = _FTPOpen('FTPControl') $Conn = _FTPConnect($Open, $server, $username, $pass) $Ftpp = _FTPMakeDir($Conn, "Test") $Ftpp1 = _FTPSetCurrentDir($Conn, "Test") $Ftpp2 = _FtpPutFile($Conn, 'C:\test.au3', 'test2.au3') $Ftpp3 = _FTPGetCurrentDir($Conn) $Ftpc = _FTPClose($Open) MsgBox(0,"Current Ftp Directory", $Ftpp3) Link to comment Share on other sites More sharing options...
BabyBeast Posted January 22, 2006 Share Posted January 22, 2006 ;=============================================================================== ; ; Function Name: _FTPFindFirstFile() ; Description: Find to see if file exist. ; Parameter(s): $l_FTPSession - The Long from _FTPConnect() ; $l_FTPFileName - file name to search ; Requirement(s): DllCall, wininet.dll ; Return Value(s): On Success - Return File Name ; On Failure - 0 ; Author(s): Beast ; ;=============================================================================== Func _FTPFindFirstFile($l_FTPSession, $l_FTPFileName, $l_Flags = 2, $l_Context = 0) Local $v_Struct_WIN32_FIND_DATA = DllStructCreate('dword;dword[2];dword[2];dword[2];dword;dword;dword;dword;char[260];char[14]') DllStructSetData($v_Struct_WIN32_FIND_DATA, 1, DllStructGetSize($v_Struct_WIN32_FIND_DATA)) Local $ai_FTPFindFirstFile = DllCall('wininet.dll', 'int', 'FtpFindFirstFile', 'long', $l_FTPSession, 'str', $l_FTPFileName, 'ptr', DllStructGetPtr($v_Struct_WIN32_FIND_DATA), 'long', $l_Flags, 'long', $l_Context) If @error OR $ai_FTPFindFirstFile[0] = 0 Then SetError(-1) Return 0 EndIf Return DllStructGetData($v_Struct_WIN32_FIND_DATA,9) ;Return $ai_FTPFindFirstFile[0] EndFunc ;==> _FTPFindFirstFile() Link to comment Share on other sites More sharing options...
thefluxster Posted January 23, 2006 Share Posted January 23, 2006 (edited) For those of you interested, I added a bit of code to the functions to allow them to accept paths that contain backslashes instead of forward slashes. This makes it so I don't have to replace them before passing them to the functions (which is handy when I'm mirroring a massive directory structure of a particular windows box on an FTP server). Here's the code I added: if StringInStr($s_Remote, "\") Then $s_Remote = StringReplace($s_Remote, "\", "/") EndIf Edited January 23, 2006 by thefluxster “Efficiency is doing things right; effectiveness is doing the right things.”-Peter F. Drucker Link to comment Share on other sites More sharing options...
billmez Posted January 24, 2006 Share Posted January 24, 2006 Excellent work wouter. Some additions below to answer a few requests here. I've defined constants to pass to the open, get, and put functions to facilitate binary, ascii and passive connections. There is a new function _FTPCommand() that will allow you to pass any command that the FTP server understands. You can send a command to change the mode to passive and binary transfer before an upload or download, and then send a command back to ascii to retrieve a directory listing. Although I haven't tried it against a *NIX server, it should support chmod and similar command also. Note: This passes the actual FTP server command, not a constant as defined below. enjoy, billmez expandcollapse popup; define some constants - can be used with _FTPPutFile and _FTPGetFile and ftp open flags Const $INTERNET_FLAG_PASSIVE = 0x08000000 Const $INTERNET_FLAG_TRANSFER_ASCII = 0x00000001 Const $INTERNET_FLAG_TRANSFER_BINARY = 0x00000002 Const $INTERNET_DEFAULT_FTP_PORT = 21 Const $INTERNET_SERVICE_FTP = 1 ;=============================================================================== ; ; Function Name: _FTPCommand() ; Description: Sends a command to an FTP server. ; Parameter(s): $l_FTPSession - The Long from _FTPOpen() ; $s_FTPCommand - Commad string to send to FTP Server ; $l_ExpectResponse - Data socket for response in Async mode ; $s_Context - A pointer to a variable that contains an application-defined ; value used to identify the application context in callback operations ; $s_Handle - A pointer to a handle that is created if a valid data socket is opened. ; The $s_ExpectResponse parameter must be set to TRUE for phFtpCommand to be filled. ; ; Requirement(s): DllCall, wininet.dll ; Return Value(s): On Success - Returns an indentifier. ; On Failure - 0 and sets @ERROR ; Author(s): Bill Mezian ; ; Command Examples: depends on server syntax. The following is for ; Binary transfer, ASCII transfer, Passive transfer mode (used with firewalls) ; 'type I' 'type A' 'pasv' ; ;=============================================================================== Func _FTPCommand($l_FTPSession, $s_FTPCommand, $l_Flags = 0x00000001, $l_ExpectResponse = 0, $l_Context = 0, $s_Handle = '') Local $ai_FTPCommand = DllCall('wininet.dll', 'int', 'FtpCommand', 'long', $l_FTPSession, 'long', $l_ExpectResponse, 'long', $l_Flags, 'str', $s_FTPCommand, 'long', $l_Context, 'str', $s_Handle) If @error OR $ai_FTPCommand[0] = 0 Then SetError(-1) Return 0 EndIf ;Return $s_return Return $ai_FTPCommand[0] EndFunc;==> _FTPCommand() Link to comment Share on other sites More sharing options...
Stumpii Posted February 21, 2006 Share Posted February 21, 2006 (edited) Here is a little addition that I wrote to upload a complete website to an ftp server. It uploads a folder's contents to a remote folder with option of uploading subdirectories. Hope it helps someone out. Edited for typos. expandcollapse popup;=================================================================================================== === ; ; Function Name: _FTPPutFolderContents() ; Description: Puts an folder on an FTP server. Recursivley if selected ; Parameter(s): $l_InternetSession - The Long from _FTPConnect() ; $s_LocalFolder - The local folder i.e. "c:\temp". ; $s_RemoteFolder - The remote folder i.e. '/website/home'. ; $b_RecursivePut - Recurse through sub-dirs. 0=Non recursive, 1=Recursive ; Requirement(s): DllCall, wininet.dll ; Author(s): Stumpii ; ;=================================================================================================== === Func _FTPPutFolderContents($l_InternetSession, $s_LocalFolder, $s_RemoteFolder, $b_RecursivePut) ; Shows the filenames of all files in the current directory. $search = FileFindFirstFile($s_LocalFolder & "\*.*") ; Check if the search was successful If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern") Exit EndIf While 1 $file = FileFindNextFile($search) If @error Then ExitLoop If StringInStr(FileGetAttrib($s_LocalFolder & "\" & $file), "D") Then _FTPMakeDir($l_InternetSession, $s_RemoteFolder & "/" & $file) If $b_RecursivePut Then _FTPPutFolderContents($l_InternetSession, $s_LocalFolder & "\" & $file, $s_RemoteFolder & "/" & $file, $b_RecursivePut) EndIf Else _FTPPutFile($l_InternetSession, $s_LocalFolder & "\" & $file, $s_RemoteFolder & "/" & $file, 0, 0) EndIf WEnd ; Close the search handle FileClose($search) EndFunc ;==>_FTPPutFolderContents Edited February 21, 2006 by Stumpii Give a man a script; you have helped him for today. Teach a man to script; and you will not have to hear him whine for help.AutoIt4UE - Custom AutoIt toolbar and wordfile for UltraEdit/UEStudio users.AutoIt Graphical Debugger - A graphical debugger for AutoIt.SimMetrics COM Wrapper - Calculate string similarity. Link to comment Share on other sites More sharing options...
hoppy Posted March 30, 2006 Share Posted March 30, 2006 Nice work guys, but is there a possibility to put a complete folder (with or without subfolders) to a ftp server but not overwriting files that haven't changed, so only edited files or new ones? With larger folders in which little updates this might be very usefull. I'm not smart enough with the more complex loops and so, so could use a hand. Thanks Link to comment Share on other sites More sharing options...
Andre Celie Posted March 31, 2006 Share Posted March 31, 2006 Is there also a function for getting the newest file in a remote directory? Or just a function for getting a file from a ftp site, from a input box? Link to comment Share on other sites More sharing options...
SpookMeister Posted April 14, 2006 Share Posted April 14, 2006 Have you looked into Secure FTP? [u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote] Link to comment Share on other sites More sharing options...
SpookMeister Posted April 28, 2006 Share Posted April 28, 2006 (edited) Figured out how to list files: Func _FTPListFiles($l_FTPSession, $l_Flags = 0, $l_Context = 0) $str = "dword;int64;int64;int64;dword;dword;dword;dword;char[256];char[14]" $WIN32_FIND_DATA = DllStructCreate($str) Local $callFindFirst = DllCall('wininet.dll', 'int', 'FtpFindFirstFile', 'long', $l_FTPSession, 'str', "", 'ptr', DllStructGetPtr($WIN32_FIND_DATA), 'long', $l_Flags, 'long', $l_Context) If Not $callFindFirst[0] Then MsgBox(0, "Folder Empty", "No Files Found ") SetError(-1) Return 0 EndIf $ret = "" While 1 If DllStructGetData($WIN32_FIND_DATA, 1) <> 16 Then $ret = $ret & DllStructGetData($WIN32_FIND_DATA, 9) & "|" Local $callFindNext = DllCall('wininet.dll', 'int', 'InternetFindNextFile', 'long', $callFindFirst[0], 'ptr', DllStructGetPtr($WIN32_FIND_DATA)) If Not $callFindNext[0] Then ExitLoop EndIf WEnd $WIN32_FIND_DATA = 0 Return StringTrimRight($ret, 1) EndFunc ;==>_FTPListFiles sigh... why do I bang my head against things when just reading the earlier posts provides the solutions Edited April 28, 2006 by SpookMeister [u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote] Link to comment Share on other sites More sharing options...
MadBoy Posted May 11, 2006 Share Posted May 11, 2006 w0uter maybe you could gather all the code from this thread and put it into your UDF?? Or you're planning to rls some new version soon? It would be realy nice to have all of it like listing files etc in UDF (and later on included in beta) for easy use. Or did you abandomed this project ? My little company: Evotec (PL version: Evotec) Link to comment Share on other sites More sharing options...
jerran Posted May 11, 2006 Share Posted May 11, 2006 I am having some difficulty with the following bit of code. I am trying to use the _FTPGetFileSize function to compare the size of the file after it was ftp'ed to before it was ftp'ed. on the first pass through the while loop the file will be transmitted and I get the size just fine, on the second pass it will error out on the _FTPputfile command as if the connection was closed. I thought it had to do with the following statement in the _FTPGetFileSize function : DllCall('wininet.dll', 'int', 'InternetCloseHandle', 'str', $l_FTPSession) where the InternetCloseHaldle part might be closing the ftp connection that I have open. Any help on this would be great. Please ignore all my useless Msgboxes I'm still learning the AutoIt stuff Thanks, Jer $Open = _FTPOpen('myFTP') If @error Then MsgBox(0, "Error", "FTP OPEN Failed") Exit EndIf $Conn = _FTPConnect($Open, $ftpserver, $username, $password) If @error Then MsgBox(0, "Error", "FTP CONN Failed") Exit EndIf $Fset = _FtpSetCurrentDir($Conn, $server_files) If $Fset = "0" Then MsgBox(0, "Error", "FTP CD Failed") Exit EndIf If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern") Exit EndIf If $dirsize = "0" Then MsgBox(0, "Error", "No Directory Size") Exit EndIf $size = "0" $done = "0" $filesize = "0" $percent = "0" While 1 $file = FileFindNextFile($search) If @error Then ExitLoop If $file <> "." AND $file <> ".." Then ; MsgBox(0, "FILENAME", $file) ; Msgbox(0, "CONN", $Conn) ; Msgbox(0, "CLIENT FILES", $client_files & $file) $Ftpp = _FtpPutFile($Conn, $client_files & $file, $file) If $Ftpp = "0" Then MsgBox(0, "Error", "FTP PUT Failed") Exit EndIf $ftpfilesize = _FTPGetFileSize($Conn, $file) Msgbox(0, "FTPFILEGETSIZE", $ftpfilesize) ; If $ftpfilesize = "0" Then ; Msgbox(0, "Error", "FTP Get Size FAILED") ; Exit ; EndIf $filesize = FileGetSize($client_files&$file) ; MsgBox(0, $file, $filesize) ; If $ftpfilesize <> $filesize Then ; Msgbox(0, "ERROR", "FILE SIZES DON'T MATCH") ; sleep(1000) ; Exit ; EndIf $size = $size + $filesize ; MsgBox(0, "SIZE", $size) $done = ($size/$dirsize)*100 ; MsgBox(0, "DONE", $done) $percent = StringFormat("%.0f" , $done) ; MsgBox(0, "PERCENT DONE", $percent) GUICtrlSetData($progressbar, $percent) EndIf Wend Msgbox(0, "Info", "FTP Complete") sleep(1000) $Ftpc = _FTPClose($Open) FileClose($search Link to comment Share on other sites More sharing options...
3telnick Posted June 9, 2006 Share Posted June 9, 2006 (edited) Figured out how to list files: Func _FTPListFiles($l_FTPSession, $l_Flags = 0, $l_Context = 0) $str = "dword;int64;int64;int64;dword;dword;dword;dword;char[256];char[14]" $WIN32_FIND_DATA = DllStructCreate($str) Local $callFindFirst = DllCall('wininet.dll', 'int', 'FtpFindFirstFile', 'long', $l_FTPSession, 'str', "", 'ptr', DllStructGetPtr($WIN32_FIND_DATA), 'long', $l_Flags, 'long', $l_Context) If Not $callFindFirst[0] Then MsgBox(0, "Folder Empty", "No Files Found ") SetError(-1) Return 0 EndIf $ret = "" While 1 If DllStructGetData($WIN32_FIND_DATA, 1) <> 16 Then $ret = $ret & DllStructGetData($WIN32_FIND_DATA, 9) & "|" Local $callFindNext = DllCall('wininet.dll', 'int', 'InternetFindNextFile', 'long', $callFindFirst[0], 'ptr', DllStructGetPtr($WIN32_FIND_DATA)) If Not $callFindNext[0] Then ExitLoop EndIf WEnd $WIN32_FIND_DATA = 0 Return StringTrimRight($ret, 1) EndFunc;==>_FTPListFiles sigh... why do I bang my head against things when just reading the earlier posts provides the solutions It doesn't work when used twice or more times... #include <c:\program files\autoit3\include\FTP.au3> $Open = _FTPOpen("FTP") $Conn = _FTPConnect($Open, "FTPserver", "user", "pass") $Fset = _FtpSetCurrentDir($Conn, "/dir/subdir1") Msgbox(0, _FtpGetCurrentDir($Conn), _FTPListFiles($Conn,0,0)) $Fset = _FtpSetCurrentDir($Conn, "/dir/subdir2") Msgbox(0, _FtpGetCurrentDir($Conn), _FTPListFiles($Conn,0,0)) $Ftpc = _FTPClose($Open) or I am doing something wrong? Edited June 9, 2006 by 3telnick Link to comment Share on other sites More sharing options...
pootie tang Posted June 28, 2006 Share Posted June 28, 2006 Here is a little addition that I wrote to upload a complete website to an ftp server. It uploads a folder's contents to a remote folder with option of uploading subdirectories. Hope it helps someone out. Edited for typos. expandcollapse popup;=================================================================================================== === ; ; Function Name: _FTPPutFolderContents() ; Description: Puts an folder on an FTP server. Recursivley if selected ; Parameter(s): $l_InternetSession - The Long from _FTPConnect() ; $s_LocalFolder - The local folder i.e. "c:\temp". ; $s_RemoteFolder - The remote folder i.e. '/website/home'. ; $b_RecursivePut - Recurse through sub-dirs. 0=Non recursive, 1=Recursive ; Requirement(s): DllCall, wininet.dll ; Author(s): Stumpii ; ;=================================================================================================== === Func _FTPPutFolderContents($l_InternetSession, $s_LocalFolder, $s_RemoteFolder, $b_RecursivePut) ; Shows the filenames of all files in the current directory. $search = FileFindFirstFile($s_LocalFolder & "\*.*") ; Check if the search was successful If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern") Exit EndIf While 1 $file = FileFindNextFile($search) If @error Then ExitLoop If StringInStr(FileGetAttrib($s_LocalFolder & "\" & $file), "D") Then _FTPMakeDir($l_InternetSession, $s_RemoteFolder & "/" & $file) If $b_RecursivePut Then _FTPPutFolderContents($l_InternetSession, $s_LocalFolder & "\" & $file, $s_RemoteFolder & "/" & $file, $b_RecursivePut) EndIf Else _FTPPutFile($l_InternetSession, $s_LocalFolder & "\" & $file, $s_RemoteFolder & "/" & $file, 0, 0) EndIf WEnd ; Close the search handle FileClose($search) EndFunc;==>_FTPPutFolderContents Do you have a function for the reverse of this (i.e. _FTPGetFolderContents)? Would like to use it get new files and such (sub-folders also in needed) for a given location. Thanks in advance Link to comment Share on other sites More sharing options...
Matrix112 Posted June 29, 2006 Share Posted June 29, 2006 Hi, nice UDF, but i´m missing some functions, i want to edit my file on the server. I wrote a function _FTPFileOpen, but can´t get it to work. expandcollapse popup;=================================================================================================== == ; ; Function Name: _FTPOpenFile() ; Description: Open a File. ; Parameter(s): $l_FTPSession - The Long from _FTPConnect() ; $s_FilePath - Path to the file. ; $access - 1 for Write 2 or other for Read mode, but not both. ; $mode - 1 for ASCII mode, 2 or other for Binary mode. ; $l_Context - Pointer to a variable that contains the application-defined ; value that associates this search with any application data. This is only used if the application ; has already called InternetSetStatusCallback to set up a status callback function. ; Requirement(s): DllCall, wininet.dll ; Return Value(s): On Success - 1 ; On Failure - 0 ; Author(s): Matrix112 ; ;=================================================================================================== == Func _FTPOpenFile($l_FTPSession, $s_FilePath, $access, $mode, $l_Context = 0) If $access = 1 Then $dwAccess = "GENERIC_WRITE" Else $dwAccess = "GENERIC_READ" EndIf If $mode = 1 Then $dwFlags = "FTP_TRANSFER_TYPE_ASCII" Else $dwFlags = "FTP_TRANSFER_TYPE_BINARY" EndIf Local $ai_FTPOpenFile = DllCall('wininet.dll', 'none', 'FtpOpenFile', 'long', $l_FTPSession, 'str', $s_FilePath, 'int', $dwAccess, 'int', $dwFlags, 'long', $l_Context) If @error OR $ai_FTPOpenFile[0] = 0 Then SetError(-1) Return 0 EndIf Return $ai_FTPOpenFile[0] EndFunc My code: expandcollapse popup#include <GuiConstants.au3> #include <File.au3> #include <FTP.au3> If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000 GuiCreate("News writer", 377, 301,(@DesktopWidth-377)/2, (@DesktopHeight-301)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) $titel = GuiCtrlCreateInput("", 110, 30, 220, 20) $Label_2 = GuiCtrlCreateLabel("News Titel", 40, 30, 50, 20) $text = GuiCtrlCreateEdit("", 40, 70, 320, 150) $write = GuiCtrlCreateButton("Write to file", 40, 260, 100, 30) $cancel = GuiCtrlCreateButton("Cancel", 170, 260, 100, 30) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Or $msg = $cancel Exit Case $msg = $write write () Exit EndSelect WEnd Exit Func write () $server = 'serveradress' $username = 'user' $pass = 'pass' $fpath = '/www/index.html' $titelr = GUICtrlRead($titel) $textr = GUICtrlRead($text) $pastetxt = "text" $Open = _FTPOpen('MyFTP Control') $Conn = _FTPConnect($Open, $server, $username, $pass) $openf = _FTPOpenFile ($Open, $fpath, 1, 2) $fw = _FileWriteToLine($openf, 80, $pastetxt, 0) If @error = 0 Then MsgBox(0,"Erfolgreich", "File erfolgreich geupdated") Else MsgBox(0,"Fehler", "Es ist ein Fehler aufgetreten") EndIf $Ftpc = _FTPClose($Open) EndFunc Can someone tell me whats wrong? Link to comment Share on other sites More sharing options...
w0uter Posted June 29, 2006 Author Share Posted June 29, 2006 (edited) $ftpsession is an array IIRC. (maby im wrong and have not released those yet) [edit] oh i see GENERIC_WRITE and such should be a binary constant not a string [/edit] Edited June 29, 2006 by w0uter My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll 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