@ZilaRozi. Actually, I do have a suggestion. I have noticed that sometimes the file mime type that we think it is, isn’t the file mime type that is detected. For example, we may both think it is obvious and safe to assume that the file mime is application/pdf, but when it is actually uploaded and detected, the file mime may turn out to be application/octet-stream. What I suggest that you do is to find out exactly what mime type is detected by using my test_script3 (Just replace the file name in the php file). That way, you know what is going on. Hope this helps.
Let me know if it works.