hi,
am working on prestashop 1.7 . i made a tpl file with form to upload image . when button submit i will move upload image to an image folder and call email functionality to add attachment , my email functionality is working fine but in controller (i have added my own controller) i cant move image to a particular folder.
my code to move uploaded file is given below.
******************************************************************************************************
if (isset($_FILES['fileUpload']['name']) && !empty($_FILES['fileUpload']['name']) && !empty($_FILES['fileUpload']['tmp_name']))
{
$move =$url.__PS_BASE_URI__.'/img/';
//echo __PS_BASE_URI__;die;
$uploadedFile = $_FILES['fileUpload']['tmp_name'];
if(move_uploaded_file($uploadedFile, $url.__PS_BASE_URI__.'/img/'.$_FILES["fileUpload"]["name"]))
{
chmod($move, 0755);
echo "upload complete";die;
}
else{echo " 1error";die;}
echo dirname(__FILE__).'';die;
}
**************************************************************************************************************************
function never entering in if(move_uploaded_file($uploadedFile, $url.__PS_BASE_URI__.'/img/'.$_FILES["fileUpload"]["name"])) this condition , always going to else condition.
please let me know is there any issue in my code or how to resolve this issue.
waiting for your valuable reply