Sign in to follow this  
Followers 0
erikson

FTP help

4 posts in this topic

it is possibe to copy an entire folder from a ftp?

there is some changedir (on a ftp) commands in autoit?

Share this post


Link to post
Share on other sites



i find something

CODE

;===================================================================================================

;

; 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

maybe you know how to modify this UDF top feet my needs :)

Share this post


Link to post
Share on other sites

You were so close, just switch the put with get and do a search to get this:

http://www.autoitscript.com/forum/index.ph...st&p=253635


"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0