Asheeown Posted February 18, 2007 Author Share Posted February 18, 2007 Yeah but still it's coming up false Quote Link to comment Share on other sites More sharing options...
sspoke Posted February 18, 2007 Share Posted February 18, 2007 outputed :-) try the php.ini confs maybe your transfer is limited does it work with a normal FTP client? Quote Link to comment Share on other sites More sharing options...
Asheeown Posted February 18, 2007 Author Share Posted February 18, 2007 You know that would make a good point, I'm not sure I use an ssh client to connect to all my servers, but I will look into the php.ini file Quote Link to comment Share on other sites More sharing options...
Asheeown Posted February 18, 2007 Author Share Posted February 18, 2007 Nothing in php.ini that says I can't download anywhere this big of a file so thats not the problem, I reversed the script and told it to put this time and still it outputted false, I'm starting to think that it might be logged in as a guest or something and just can't download or do anything, is their a way to check the status of the connection? Quote Link to comment Share on other sites More sharing options...
ShogunWarrior Posted February 18, 2007 Share Posted February 18, 2007 Can you give us the full code you are using now? Quote Link to comment Share on other sites More sharing options...
Asheeown Posted February 18, 2007 Author Share Posted February 18, 2007 <?php include("include/Config.php"); // Set Variables $Server = "***.***.***.***"; // Remote Server $Username = "********"; // Remote Server Username $Password = "*********"; // Remote Server Password $Directory = "***"; // Remote Server Directory $Type = "Raw"; // Example: Raw $Table = "sansay_raw"; // CDR Table name $LocalDirectory = "CDRS/"; // CDR Local Directory // Do not change anything below this line $LocalDirectory = $LocalDirectory . $Type; $FtpConnect = ftp_connect($Server); $Login = ftp_login($FtpConnect, $Username, $Password); ftp_chdir($FtpConnect, $Directory); echo "Current Directory: "; echo ftp_pwd($FtpConnect); echo "<br /><br /><br />"; $Files = ftp_nlist($FtpConnect, ".") or die("Line 21"); foreach($Files as $f) { $Remote = "/$Directory/$f"; $Local = "$f"; $LocalF = fopen($Local,'w'); echo "File: $Remote is being written as $Local<br>"; if(ftp_fget($FtpConnect, $LocalF, $Remote, FTP_BINARY)) { echo "File: $Remote was downloaded successfully"; } else { echo "File: $Remote was not downloaded"; } fclose($LocalF); } ftp_close($FtpConnect); ?> Absolutely everything on the page, all personal information *ed Quote Link to comment Share on other sites More sharing options...
ShogunWarrior Posted February 18, 2007 Share Posted February 18, 2007 I edited the code slightly to only try and download the files we want but it works perfectly for me remotely to my FTP: foreach($Files as $f) { $Remote = "/$Directory/$f"; $Local = "$f"; if( preg_match( '/\.(cdr|php|txt|jpg|jpeg|gif)$/i', $Local ) ) { $LocalF = fopen($Local,'w'); echo "File: $Remote is being written as $Local<br>"; if(ftp_fget($FtpConnect, $LocalF, $Remote, FTP_BINARY)) { echo "File: $Remote was downloaded successfully"; } else { echo "File: $Remote was not downloaded"; } fclose($LocalF); } } Quote Link to comment Share on other sites More sharing options...
Asheeown Posted February 18, 2007 Author Share Posted February 18, 2007 Output = False....I just don't understand it Quote Link to comment Share on other sites More sharing options...
ShogunWarrior Posted February 18, 2007 Share Posted February 18, 2007 The code should really be working. Quote Link to comment Share on other sites More sharing options...
Asheeown Posted February 18, 2007 Author Share Posted February 18, 2007 Exactly thats what has made me pop about 4 aspirins today lol. It's stumping me Quote Link to comment Share on other sites More sharing options...
sspoke Posted February 18, 2007 Share Posted February 18, 2007 made me pop about 4 aspirins today rofl.. ya its a mystery Quote Link to comment Share on other sites More sharing options...
Asheeown Posted February 19, 2007 Author Share Posted February 19, 2007 Since we know that the code should work for another situation, how would my server settings or the remote server's settings effect this code? Already checked into my php.ini on my local server and everything even remotely related to ftp checks out Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.