CMD Prompt > FTP Size Command

ttliorangecolor

New Member
I'm developing a PHP App on IIS 7.5, which uses PHP FTP commands.These all work, apart from \[code\]ftp_size()\[/code\].I've tested:\[code\]cmd.exe > ftp host > username > password > SIZE filename = Invalid Command\[/code\]However, if I access the FTP site through an Internet Browser, the filesize is displayed.Do I need to install FTP Extensions, and if so, which ones and where do I get them?Here is the PHP Code:\[code\]<?php// FTP Credentials$ftpServer = "www.domain.com";$ftpUser = "username";$ftpPass = "password";// Unlimited Timeset_time_limit(0);// Connect to FTP Server$conn = @ftp_connect($ftpServer)or die("Couldn't connect to FTP server");// Login to FTP Site$login = @ftp_login($conn, $ftpUser, $ftpPass)or die("Login credentials were rejected");// Set FTP Passive Mode = Trueftp_pasv ($conn, true);// Build the file list$ftp_nlist = ftp_nlist($conn, ".");// Alphabetical sortingsort($ftp_nlist);// Display Outputforeach ($ftp_nlist as $raw_file) { // Get the last modified time $mod = ftp_mdtm($conn, $raw_file); // Get the file size $size = ftp_size($conn, $raw_file); // Size is not '-1' => file if (!(ftp_size($conn, $raw_file) == -1)) { //output as file echo "Filename: $raw_file<br />"; echo "FileSize: ".number_format($size, '')."Kb</br>"; echo "Last Modified: ".date("d/m/Y H:i", $mod)."</br>"; }}?>\[/code\]
 
Back
Top