Following this thread: PHP file upload: mime or extension based verification? I assume that I need to check the file extension of the file that I am uploading, correct ?
I am trying to upload a binary file that results from a make file into a Raspberry using a PHP Interface.
This is the file in question:
Big_ppd_display_try1: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=047e67dcea785cb3139bc690aebcf0d537ef40fe, with debug_info, not stripped
Following this thread: php check file extension in upload form
I can try:
$allowed = array('gif','png' ,'jpg');
$filename = $_FILES['uploaded_file']['name'];
$ext = pathinfo($filename, PATHINFO_EXTENSION);
if(!in_array($ext,$allowed) ) {
echo 'error';
}
But how do I tell PHP to only allow binary files like Big_ppd_display_try1
that have no file extension ?
Also, I am doing the upload from a Linux machine. How will that binary file look like on a Windows PC ?