<?php
if(isset($_FILES['file']))
{
$original_url='adminPanel/Images/';
$currentDate = new DateTime();
$currentTimestamp = $currentDate->format("YmdHis");
$randomNumber= mt_rand(1111, 9999);
$filePath=$_FILES['file']['name'];
$fileName = $currentTimestamp.$randomNumber.$filePath;
$source = $_FILES['file']['tmp_name'];
$ext = end((explode(".", $filePath)));//take extension from image/video
$fileName = $currentTimestamp.$randomNumber.".".$ext;
$original = $original_url.$fileName;
move_uploaded_file($source,$original );
}
?>
PHP Warning: move_uploaded_file(adminPanel/Images/201704210824047891.JPG): failed to open stream: No such file or directory in G:\PleskVhosts\sinnonteq.com\qhawk.sinnonteq.com\adminPanel\Product.php on line 19
PHP Warning: move_uploaded_file(): Unable to move 'C:\Windows\Temp\phpC5EE.tmp' to 'adminPanel/Images/201704210824047891.JPG' in G:\PleskVhosts\sinnonteq.com\qhawk.sinnonteq.com\adminPanel\Product.php on line 19
adminPanel/Images/
but is on a different level in the physical file tree. – arkascha