Wednesday, May 11, 2005

[itsdifferent] Display FTP file copy progress

hi all,

i m copying a file from FTP to WEB server.
php script is running in WEB server.
i want to display file copy progress.

'ftp_nb_get' ftp function is used

it works fine. but not able to display copy progress

if u understand above problem plz do not read below


i have one php script
the script copy a file from FTP server to WEB server

i am using 'ftp_nb_get' command
this function retrieves the file asynchronously
so i can do other task while copying file

i want to display progress for copying the file
so i need,how bytes copyed

for that i am using
[[ $x=passthru("ls -s"); ]]     
in while loop.
it returns KB FILE_NAME     

actual problem is
i am not able to use any PHP function to retrive only
i tried split, substr  both dosent work

value of $x remains same


// Initate the download
$ret = ftp_nb_get($my_connection, "test", "README",
while ($ret == FTP_MOREDATA) {
  // displaying file size
  $x=passthru("ls -s");
  echo $x."<br>";

  // Continue downloading...
  $ret = ftp_nb_continue ($my_connection);
if ($ret != FTP_FINISHED) {
  echo "There was an error downloading the file...";


Chauhan Yatin
GSM:- +91-9824-228276

Yahoo! Mail
Stay connected, organized, and protected. Take the tour:

Note: This Group is not a Job Searching Group, so please co-operate and dont transfer any kind of job related material across this Group.AnyOne doing so can be banned from the Group
Thanx , Group Co-Ordinators

Yahoo! Groups Links

No comments: