I'm not a php expert, but I must upload files from one server to another (server 2). In server 2, I have a shared folder with R/W for everyone (I granted that). But I can't upload the files, this is the part for uploading files:
<?php
if(isset($_FILES['image']))
{
$errors= array();
$file_name = $_FILES['image']['name'];
$file_size = $_FILES['image']['size'];
$file_tmp = $_FILES['image']['tmp_name'];
$file_type = $_FILES['image']['type'];
$file_ext=strtolower(end(explode('.',$_FILES['image']['name'])));
if(empty($errors)==true)
{
//$archivo = "uploads/".$file_name;
$archivo = "\\\\192.168.0.63\\e$\\Sitios Web\\WSDocuware\\Files".$file_name;
echo "Ruta archivo => ". $archivo."</br></br></br>";
//move_uploaded_file($file_tmp,"uploads/".$file_name);
move_uploaded_file($file_tmp,"\\\\192.168.0.63\\e$\\Sitios Web\\WSDocuware\\Files".$file_name);
//$open = fopen("uploads/".$file_name, 'r');
$open = fopen("\\\\192.168.0.63\\e$\\Sitios Web\\WSDocuware\\Files".$file_name, 'r');
}
print_r($_FILES);
}
?>
Where 192.168.0.63 is my ip server, I tried with: $archivo = "\\192.168.0.63\Sitios Web\WSDocuware\Files".$file_name; I tried with drive maping that folder, But I can't upload files. It works just in php server.
I hope anyone can help me please.
<html>
<head>
<title>SUBIR ARCHIVO DW</title>
<link rel="stylesheet" type="text/css" title="Cool stylesheet" href="consumidor.css">
<form action="" method="post" enctype="multipart/form-data">
<table border="1" style="font-family:arial; font-size: 10px;" >
<tr>
<td>
<input type = "file" name = "image" />
</td>
<td>
<input type = "submit" name = "btnCargar" value="1.- Cargar"/>
</td>
<td>
<input type="submit" name="btnData" value="2.- Abrir">
</td>
<td> Fecha Desde
<input id="datetimeD" type="date" name="doa">
</td>
<td> Fecha Hasta
<input id="datetimeH" type="date" name="dob">
</td>
<td>
<input type="submit" name="btnExpr" value="3.- Comparar">
</td>
<td>
<ul>
<li>Archivo Enviado: <?php echo $_FILES['image']['name']; ?>
<li>Tamano (bytes): <?php echo $_FILES['image']['size']; ?>
<li>Tipo Archivo: <?php echo $_FILES['image']['type'] ?>
</ul>
</td>
<td>
<a href="export-rpt.php">Exportar a Excel</a>
</td>
</tr>
</table>
</form>
best regards