Client-side image processing with HTML

JavascriptWeb DevelopmentFront End Scripts

For client-side processing and uploading, you can try to run the following code −

<?php
   if (isset($_FILES["image"])) {
      $ iSize = getimagesize($_FILES["image"]["tmp_name"]);

      if ($iSize!== false) {
         $myFile = "/tmp/" . basename($_FILES["image"]["name"]);

         if (move_uploaded_file($_FILES["image"]["tmp_name"], $myFile)) {
            echo "File stored at " . $myFile;
         } else {
            echo "Image storage failed!";
         }
      } else {
         echo "This isn’t an image!";
      }
   } else {
      echo "Image not available to upload!";
   }
?>
raja
Published on 05-Apr-2018 12:46:18
Advertisements