Sparrowlord Posted June 4, 2007 Share Posted June 4, 2007 Hey I'm trying to upload the entire contents of this folder to my FTP , but I dont know how.. $pepsidir = @DesktopCommonDir & "\Pepsi\" Maybe some how if you could array all the contents of the folder to something then when I upload Ill use something like: $Ftpp = _FtpPutFile ($Conn, $Array, $folder) $Array being all the files in the " Pepsi " folder on the desktop. I've been working on this for hours and cant get anything to work, so I need help bad! Link to comment Share on other sites More sharing options...
poisonkiller Posted June 4, 2007 Share Posted June 4, 2007 Look in help file for FileFindFirstFile and FileFindNextFile. Then you can use For...Next loop and upload every file. Link to comment Share on other sites More sharing options...
Zedna Posted June 4, 2007 Share Posted June 4, 2007 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 Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Sparrowlord Posted June 4, 2007 Author Share Posted June 4, 2007 Or better yet instead of uploading the whole directory theres only a few files I want in there.. heres an example: " nfs:value[*].txt " The * means there could be 0 and up there, is there anyway to only get them files to an array? Link to comment Share on other sites More sharing options...
Zedna Posted June 4, 2007 Share Posted June 4, 2007 (edited) Or better yet instead of uploading the whole directory theres only a few files I want in there.. heres an example: " nfs:value[*].txt " The * means there could be 0 and up there, is there anyway to only get them files to an array? Look into Autoit helpfile at _FileListToArray() That's exactly what you need. Edited June 4, 2007 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Sparrowlord Posted June 5, 2007 Author Share Posted June 5, 2007 Look into Autoit helpfile at _FileListToArray()That's exactly what you need.I attempted to do that but there is more than those files that I want 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