function mput($filelist) {

        $result = true;

        foreach ($filelist as $localpath => $destpath) {

            $localpath = rtrim($localpath, "/");
            $destpath  = rtrim($destpath, "/");

            // attempt to create target path
            if (is_dir($localpath)) {
                $pathparts = explode("/", $destpath."/ "); // add one level, last level will be created as dir
            } else {
                $pathparts = explode("/", $destpath);
            }
            $checkpath = "";
            for ($i=1; $i<sizeof($pathparts)-1; $i++) {
                $checkpath .= "/" . $pathparts[$i];
                if (!($this->is_dir($checkpath))) {

                    $result &= ($this->mkcol($checkpath) == 201 );
                }
            }

            if ($result) {
                // recurse directories
                if (is_dir($localpath)) {
                    if (!$dp = opendir($localpath)) {
                        $this->_error_log("Could not open localpath for reading");
                        return false;
                    }
                    $fl = array();
                    while($filename = readdir($dp)) {
                        if ((is_file($localpath."/".$filename) || is_dir($localpath."/".$filename)) && $filename!="." && $filename != "..") {
                            $fl[$localpath."/".$filename] = $destpath."/".$filename;
                        }
                    }
                    $result &= $this->mput($fl);
                } else {
                    $result &= ($this->put_file($destpath, $localpath) == 201);
                }
            }
        }
        return $result;
    }