Can't upload file using PHP on Ubuntu | Solved


Change permission to UPLOAD file into upload folder on UBUNTU

Read + Write

sudo chmod -R a+rw images/

Read + Write + Execute

 sudo chmod -R a+rwx upload/

Example Like this:

bitnahuhi@ip-000-00-00-00:~/htdocs/admin$ sudo chmod -R a+rwx images/

 <?php 


/<?php

  $name = $_FILES['file']['name'];
  $temp = $_FILES['file']['tmp_name'];

  if(move_uploaded_file($temp,"upload/".$name)){
   echo "Your file was uploaded";
}
 else
{ 
 echo "Your file cound't upload";
}

?>

?> 


No comments:

Post a Comment

CPU vs GPU Architecture

  CPU vs GPU Architecture CPU (Central Processing Unit) and GPU (Graphics Processing Unit) have distinct architectural differences, optimize...

Best for you