I don't know what's wrong with my code. I have Z: network drive named ntserver and i want to move file in it. Only working in a local drive such as C and D.
The error displays :
Warning: move_uploaded_file(\ntserver\test\oggy_and_the_cockroaches-wide.jpg): failed to open stream: No such file or directory in C:\wamp\www\michael\upload1.php on line 30
Warning: move_uploaded_file(): Unable to move 'C:\wamp\tmp\php3FDE.tmp' to '\ntserver\test\oggy_and_the_cockroaches-wide.jpg' in C:\wamp\www\michael\upload1.php on line 30
<?
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'];
$expensions= array("jpeg","jpg","png");
if($file_size > 2097152) {
$errors[]='File size must be exactly 2 MB';
}
if(empty($errors)==true) {
move_uploaded_file($file_tmp,"\\\\ntserver\test\\".$file_name);
echo "Success";
}else{
print_r($errors);
}
}
?>