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

Angular's new httpResource and a bonus hidden feature

  The first   release candidate   for   Angular 19.2   is out, and it includes the new experimental   httpResource . This is essentially a s...

Best for you