Viewing file: ftp_upload_lardt.php (3.57 KB) -rw-rw-r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es" lang="es-es">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="../nuevo.css">
<link rel="STYLESHEET" type="text/css" href="../estilo.css">
</head>
<body>
<?php
// require the htmlform class
include("../zebraforms/class.htmlform.php");
require_once "../classes/dUnzip2.inc.php";
require_once "../classes/dZip.inc.php";
include("../classes/fb2.classtxapuza.php");
include("../conn.php") ;
//deltree("../includes2");
//mkdir("../includes2/",0777,true);
//chmod("../includes2/",0777);
$id=intval($_REQUEST['id']);
$debug=false;
// instantiate the class
$form = new HTMLForm('form', 'post',"ftp_upload_lardt.php?id=$id");
$form->maxFileSize=10240000;
// add a label to the 'name' control - used in the template file as {controls.label_name}
@$obj = $form->add('file', 'upload');
$obj->setRule(array('mandatory' => array('e1', 'Fichero Obligatorio: fichero')));
$form->add('submit', 'submit', 'enviar datos');
$form->add('reset', 'reset', 'Borrar campo');
$obj=$form->add('button', 'control_atras', 'Volver atr�s');
$obj->setAttributes(array('onclick' =>'history.back()'));
// validate the form
if ($form->validate()) {
if ($debug){
echo "<pre>";
print_r($_FILES);
print_r($_REQUEST);
}
//aqui iria la validacion del $options
$rnd=rand(1111,9999);
@ mkdir("../includes2/$rnd/",0777,true);
@ mkdir("../includes2/$rnd/libro/",0777,true);
copy ($_FILES['upload']['tmp_name'],"../includes2/$rnd/libro/".str_replace("/tmp/",'',$_FILES['upload']['tmp_name']));
@chmod("../includes2/$rnd/".str_replace("/tmp/",'',$_FILES['upload']['tmp_name']),0777);
//print_r($_FILES);
/*
echo $_REQUEST['sinopsis']."<br>";
echo htmlentities($_REQUEST['sinopsis'])."<br>";
echo rawurlencode($_REQUEST['sinopsis'])."<br>";
echo utf8_encode($_REQUEST['sinopsis'])."<br>";
echo urlencode($_REQUEST['sinopsis'])."<br>";
*/
$form2 = new HTMLForm('form', 'post',"ftp_paso3_lardt.php?file=../includes2/$rnd/libro/".htmlentities(str_replace("/tmp/",'',$_FILES['upload']['tmp_name']))."&nombre=".htmlentities($_FILES['upload']['name'])."&id=$id");
echo "<center><h2>Ficheros subidos al servidor</h2><br><br>";
$form2->add('submit', 'submit', 'Pulse para procesar');
$obj=$form2->add('button', 'control_atras', 'Volver atr�s');
$obj->setAttributes(array('onclick' =>'history.back()'));
$form2->render();
die();
}
//$form->render("./forms/ftp_inicio.xtpl");
$form->render();
function delTree($dir) {
$files = glob( $dir . '*', GLOB_MARK );
foreach( $files as $file ){
if( substr( $file, -1 ) == '/' )
delTree( $file );
else
unlink( $file );
}
if (is_dir($dir)) rmdir( $dir );
}
?>
|