I am sending a .doc file to my file upload_File.php the parameters do arrive but when I want to move the file to a folder it does nothing.
<?php
ini_set('error_reporting', E_ALL);
require_once '../mail/PHPMailer-master/PHPMailerAutoload.php';
/*$prueba = new Cliente();
$prueba->listar();*/
//include_once("../conexion/conexion.php");
$con=mysqli_connect("localhost","root","","****");
$nombre = $_POST['nombre'];
$email = $_POST['email'];
$celular = $_POST['celular'];
$comentario = $_POST['comentario'];
$directorio="../csv/";
$nombreArchvio=$_FILES['csv']['name'];
echo $directorio.' '.$nombreArchvio;
move_uploaded_file($directorio,$nombreArchvio);
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
// Perform a query, check for error
if (!mysqli_query($con, "INSERT INTO `csv`(`nombre`, `email`, `celular`, `csv`, `comentario`) VALUES ('$nombre','$email','$celular','$nombreArchvio','$comentario')"))
{
echo 'llego';
echo("Error description: " . mysqli_error($con));
}
Read the documentation for
move_uploaded_file($source, $destination)
You have to capture the physical source file as
$_FILES[foo]['tmp_name']
and it$destination
must have the full name of the destination file, either using the original,['name']
, or other custom.