-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathupload_param.php
executable file
·34 lines (33 loc) · 1.53 KB
/
upload_param.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
session_start();
require_once('app/controller/controller.coi.php');
$controller = new controller_coi;
$target_dir = "C:\\xampp\\htdocs\\uploads\\parametros\\";
$target_file = $target_dir.$_SESSION['user']->NOMBRE." ".date('d_m_Y_Hiu').basename($_FILES["fileToUpload"]["name"]);
$x = $_POST['x'];
$eje = $_POST['eje'];
$uploadOk = 0;
$fileType = pathinfo($target_file,PATHINFO_EXTENSION);
if(!file_exists($target_dir)){
mkdir($target_dir);
}
if ($_FILES["fileToUpload"]["size"] > 1000000 ){
echo "El archivo dede medir menos de 1 MB, o no coinicide el tipo de archivo con el esperado, se esperaba EXP";
$uploadOk = 0;
}else{
if ((strtoupper($fileType) != 'XLSX' or strtoupper($fileType) == 'CSV' or strtoupper($fileType== 'XLS'))){
exit(strtoupper($fileType));
echo "El Archivo que intenta cargar no es un archivo valido, solo se admiten XLS, XLSX, CSV.<p>";
$uploadOk = 0;
//$retorno = $controller->estado_de_cuenta($banco=$datos[0], $cuenta=$datos[1]);
}else{
if(move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) {
//$res=$controller->cargaEdoCtaXLS($target_file, $datos, $banco=$datos[0], $cuenta=$datos[1]);
$upl_param =$controller->upl_param($target_file, $x, $eje);
//$retorno = $controller->estado_de_cuenta($banco=$datos[0], $cuenta=$datos[1]);
} else {
echo "Ocurrio un problema al subir su archivo, favor de revisarlo.";
}
}
}
?>