// Funcion para descargar todos los archivos del repositorio de Alfresco
function downloadFiles($path) {
$total = 0;
$url_archivos = array();
// Conecto con el repositorio
$conexion = Conexion::getIstance();
if ($conexion->connectRepository($_SESSION['servidor'], $_SESSION['usuario'], $_SESSION['password'])) {
$nodes = $conexion->session->query($conexion->spacesStore, REPOSITORIO);
$guestHome = $nodes[0];
// Recojo las URL de cada archivo y las guardo en un array
foreach ($guestHome->children as $c) {
if ($c->child->type == "{http://www.alfresco.org/model/content/1.0}content") {
$contentData = $c->child->cm_content;
if ($contentData != null) {
$result = $contentData->getUrl();
}
}
// Array con la URL de cada archivo
array_push($url_archivos, $result);
}
// Recorro el array en busca de cada URL y descargo su correspondiente archivo en el path especificado
foreach ($url_archivos as $url) {
if ((@$f = fopen($url, 'r')) != false) {
fclose($f);
if ((@$f = fopen($path.basename($url), "w")) != false) {
$contenido = file_get_contents($url);
echo "Contenido: ".$contenido."<br>";
fwrite($f, $contenido);
fclose($f);
$total++;
}
}
}
}
echo "Total: ".$total;
}
Content from pre 2016 and from language groups that have been closed.
Content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.