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

commonly used in modern ASP.NET Core apps more examples using fetch + Blob in JavaScript to download files PDF, Excel

 Let’s explore real-world examples using the fetch + blob pattern, targeting different file types and scenarios. ✅ 1. Download Static PD...

Best for you