forked from ofarias/ftc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuploadJson.php
37 lines (32 loc) · 1.13 KB
/
uploadJson.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
35
36
37
<?php
session_start();
require_once('app/controller/pegaso.controller.php');
require_once('app/model/facturacion.php');
$controller = new pegaso_controller;
$dataf = new factura;
$target_dir = "C:\\xampp\\htdocs\\Facturas\\ErroresJson\\";
$target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
$uploadOk = 1;
$nombre = basename($_FILES["fileToUpload"]["name"]);
$imageFileType = pathinfo($target_file,PATHINFO_EXTENSION);
//echo 'Sube el Archivo'.$target_file;
// Check if image file is a actual image or fake image
if(isset($_POST["submit"])) {
$check = getimagesize($_FILES["fileToUpload"]["tmp_name"]);
//echo 'Paso la Validacion';
if($check !== false) {
echo "File is an image - " . $check["mime"] . ".";
$uploadOk = 1;
} else {
//echo "El Archivo es: .<p>";
$uploadOk = 1;
}
}
//exit(var_dump($imageFileType).'Nombre'.$_FILES["fileToUpload"]["name"]);
$nf="FP-10708";
$fh="C:\\xampp\\htdocs\\Facturas\\ErroresJson\\".$nf.".json";
$data = file_get_contents($fh);
$json = json_decode($data, true);
$insertaValores = $dataf->insertaJson($json,$fh);
exit();
?>