Ruzzas Posted June 22, 2010 Share Posted June 22, 2010 I've got two functions which one downloads files and zips the one that doesen't end with .dua and .txt But I want to download folders and their contents and means if a folder has a folder which has a folder and its got content, I wan't it to download the whole lot. Anyways heres the two functions: function Download($Array){ global $Connection; if($Connection){ for($i=0;$i<count($Array);$i++){ if($ArrayExplode = (explode(".", $Array[$i]))){ if($ArrayExplode[1] != "dua" & $ArrayExplode[1] != "txt"){ Zip($Array[$i]); } } if($Array[$i] != ""){ if(FolderContents($Array[$i]) == "false"){ ftp_get($Connection,$Array[$i],$Array[$i],FTP_BINARY); }else{ DownloadFolders($Array[$i]); } } } return true; }else{ return false; } } function DownloadFolders($Folder){ global $Connection; if($Connection){ if($ArrayExplode = (explode(".", $Folder))){ if($ArrayExplode[0] != "" & $ArrayExplode[1] == ""){ $FolderContents = FolderContents($Folder); for($e=0;$e<count($FolderContents);$e++){ if(mkdir($Folder,0777,true)){ if(ftp_chdir($Connection,$Folder)){ ftp_get($Connection,$FolderContents[$e],$FolderContents[$e],FTP_BINARY); } } } @ftp_cdup($Connection); } } } } Link to comment https://forums.phpfreaks.com/topic/205507-ftp_get-folders-attempted-failed-need-help-here/ Share on other sites More sharing options...
Ruzzas Posted June 22, 2010 Author Share Posted June 22, 2010 bump :/ Link to comment https://forums.phpfreaks.com/topic/205507-ftp_get-folders-attempted-failed-need-help-here/#findComment-1075425 Share on other sites More sharing options...
Ruzzas Posted June 22, 2010 Author Share Posted June 22, 2010 no one wants to help? Link to comment https://forums.phpfreaks.com/topic/205507-ftp_get-folders-attempted-failed-need-help-here/#findComment-1075451 Share on other sites More sharing options...
Ruzzas Posted June 22, 2010 Author Share Posted June 22, 2010 does no one know php anymore? Link to comment https://forums.phpfreaks.com/topic/205507-ftp_get-folders-attempted-failed-need-help-here/#findComment-1075814 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.