Предупреждение PHP: move_uploaded_file (): невозможно переместить

Я новичок в php & пытаясь построить небольшое приложение.
Приведенный ниже фрагмент успешно работает на странице php, где у нас нет другого кода, кроме этого. когда я использую тот же код в другой форме PHP выше, появляется ошибка «move_uploaded_file (): Unable to move».

if(isset($_FILES['file'])) {

$file=$_FILES['file'];
//files properties
$file_name = $file['name'];
$file_tmp = $file['tmp_name'];
$file_size = $file['size'];
$file_error = $file['error'];
// work out the files extension
$file_ext = explode('.',$file_name);
$file_ext = strtolower(end($file_ext));
$allowed = array('doc','docx','pdf','rtf','txt');
//print_r($file_ext);
if(in_array($file_ext,$allowed))
{
if($file_error==0)
{
if($file_size<=5000000)
{
$file_name_new=uniqid('',true).'.'.$file_ext;
$file_destination = '/./Resume/'.$file_name_new;
//$_SESSION['message']= $file_tmp;
if(move_uploaded_file($file_tmp,$file_destination))
{
echo"file uploaded sucessfully";
}
else
{
$_SESSION['message']= "File not uploaded to the destination".$file_name;
}
}
else
{
$_SESSION['message']= "Files size is more than 5 MB";
}
}
else
{
$_SESSION['message']= "some unexpected error happened";
}
}
else
{
$_SESSION['message']= "Please upload file matching the below extensions only";
}

}

1

Решение

Задача ещё не решена.

Другие решения

Других решений пока нет …

По вопросам рекламы ammmcru@yandex.ru
Adblock
detector