因為希望在後端也能檢查上傳格式,所以利用class.upload.php裡的allowed功能來達成,分享一下簡易作法~
主要是改寫
upload_file函數
https://gist.github.com/geek01/e59d3e045ba09854469b423fdaa9a5f9#file-tadupfiles-php-L561
因為懶的查MIME type新增
ext2mime函數https://gist.github.com/geek01/e59d3e045ba09854469b423fdaa9a5f9#file-tadupfiles-php-L1782