<?php
//Creado con Ardora - www.webardora.net
//bajo licencia Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)
//para otros usos contacte con el autor
session_start();$slogin_noauthpage=0;$slogin_pagetitle="";include_once ("paraUsu.php");include_once (profUname."../".uName."/".uName."_lib.php");include_once ("cfg.php");include_once ("ardoraFileManagerFunctions.php");session_cache_limiter("nocache,private");
$newDir=$_GET["fol"];if ($_GET["fType"]==0){$newDir="../".sharedFold.$newDir;}
if ($_GET["fType"]==1){ $tipo=dameValor($_SESSION["Username"],"TIP"); if (($tipo=="profe") || ($tipo=="admin")){$newDir="../".profeFold.$_SESSION["Username"]."/".$newDir;}else{$newDir="../".aluFold.$_SESSION["Username"]."/".$newDir;}}
if ($_GET["fType"]==2){$newDir="../".aluFold.$newDir;}
if(isset($_FILES["myfile"])){$ret = array();$error =$_FILES["myfile"]["error"];{if(!is_array($_FILES["myfile"]["name"])) {$fileName = $_FILES["myfile"]["name"];move_uploaded_file($_FILES["myfile"]["tmp_name"],$newDir.normaliza($_FILES["myfile"]["name"]));$ret[$fileName]= $newDir.$fileName;}
else{$fileCount = count($_FILES["myfile"]['name']);for($i=0; $i < $fileCount; $i++){$fileName = $_FILES["myfile"]["name"][$i];$ret[$fileName]=$newDir.$fileName;move_uploaded_file($_FILES["myfile"]["tmp_name"][$i],normaliza($newDir.$fileName));}}} echo json_encode($ret);}
?>
