• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Upload Class returning unknown/unknown type

#1
[eluser]hugle[/eluser]
Hello everyone,

someting weird happened..
I spotted, that I can't upload some zip files...
So I tried debugging Upload class, and saw, that:

Code:
$this->file_type = preg_replace("/^(.+?);.*$/", "\\1", $_FILES[$field]['type']);
        $this->file_type = strtolower(trim(stripslashes($this->file_type), '"'));

is returning unknown/unknown

If I add this two lines to check using fileinfo:
Code:
$finfo = new finfo(FILEINFO_MIME);
        $this->file_type = $finfo->file($_FILES[$field]['tmp_name']);

It is working good, returning:
application/x-zip
application/x-rar and etc, depending on file types...

Can someone point me on some other tips to debug or make 'original' class working?

Thank you very much!
cheers


Messages In This Thread
Upload Class returning unknown/unknown type - by El Forum - 08-02-2010, 03:17 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.