Welcome Guest, Not a member yet? Register   Sign In
FTP Class - How can I browse ?
#4

[eluser]Phil Sturgeon[/eluser]
If I am understanding this you want to be able to pass the directory as a URL parameter to browse any folder you like. Try the following:

Code:
<?php

class Browse extends Controller {

  function directory() {

    $dir = $_SERVER['DOCUMENT_ROOT'];
    $dir .= func_num_args() > 0 ? implode('/', func_get_args()) : 'whatever_default_folder';
    
    $list = $this->ftp->list_files($dir);

    print_r($list);

  }

}

?>

That means you can pass it the following URL http://example.com/browse/directory/test/images/.


Messages In This Thread
FTP Class - How can I browse ? - by El Forum - 12-27-2008, 09:07 AM
FTP Class - How can I browse ? - by El Forum - 12-27-2008, 09:56 AM
FTP Class - How can I browse ? - by El Forum - 12-27-2008, 10:31 AM
FTP Class - How can I browse ? - by El Forum - 12-29-2008, 03:41 AM
FTP Class - How can I browse ? - by El Forum - 12-29-2008, 10:06 AM
FTP Class - How can I browse ? - by El Forum - 12-29-2008, 10:29 AM



Theme © iAndrew 2016 - Forum software by © MyBB