Get the filesize and file extension of a file in PHP

Download
Download is available until [expire_date]
  • Version
  • Download 186
  • File Size 397.07 KB
  • File Count 1
  • Create Date September 14, 2016
  • Last Updated September 14, 2016

Get the filesize and file extension of a file in PHP

Get the filesize and file extension of a file in PHP

PHP script that will get the file size and file extension of the uploaded file.

PHP Script:

< ?php
          if(isset($_POST['save'])) 
          {
          
          $name = basename($_FILES['upload_file']['name']);
          $temp = $_FILES['upload_file']['tmp_name'];
          $filetype = $_FILES['upload_file']['type'];
          $size = $_FILES['upload_file']['size'];

            
            echo "The filetype is: ".$filetype."< br>";
            echo "The filesize is: ".$size;
          }
?>
, , , ,

Post navigation

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.