/* get file name here */
$file_name=$_FILES['profile_img']['name'];
$file_temp_name=$_FILES['profile_img']['tmp_name'];
$path_name="profile/".$file_name;
if($_FILES['profile_img']['error']>0)
{
echo "Return Code : ".$_FILES['profile_img']['error']."</br>";
}
else
{
$allowed = array('gif','png' ,'jpg');
$filename = $_FILES['profile_img']['name'];
$ext = pathinfo($filename,PATHINFO_EXTENSION);
if(!in_array($ext,$allowed))
{
echo 'File is not allowed';
}
else
{
/* Move file here */
$move_result=move_uploaded_file($file_temp_name,$path_name);
if($move_result==TRUE)
{
/* Write your success code here */
}
}
$file_name=$_FILES['profile_img']['name'];
$file_temp_name=$_FILES['profile_img']['tmp_name'];
$path_name="profile/".$file_name;
if($_FILES['profile_img']['error']>0)
{
echo "Return Code : ".$_FILES['profile_img']['error']."</br>";
}
else
{
$allowed = array('gif','png' ,'jpg');
$filename = $_FILES['profile_img']['name'];
$ext = pathinfo($filename,PATHINFO_EXTENSION);
if(!in_array($ext,$allowed))
{
echo 'File is not allowed';
}
else
{
/* Move file here */
$move_result=move_uploaded_file($file_temp_name,$path_name);
if($move_result==TRUE)
{
/* Write your success code here */
}
}