Use the following code: file names inside the .zip archive:
$zip = zip_open('test.zip'); while($entry = zip_read($zip)) { $file_name = zip_entry_name($entry); $ext = pathinfo($file_name, PATHINFO_EXTENSION); if(strtoupper($ext) !== 'MP3') { notify_admin($file_name); } }
Please note that the following code will only look at the extension. This means that the user can download anything that has the MP3 extension. To really check if the mp3 file is, you have to unzip it. I would advise you to do this in the temporary directory.
After unpacking the file, you can analyze it, for example, ffmpeg or something else. In any case, the detailed data on bitrate, track length, etc. are interesting.
If the analysis fails, you can mark the file.
hek2mgl
source share