Welcome Guest, Not a member yet? Register   Sign In
upload library processing with wrong mime type
#1

First, thanks for providing such a wonderful framework. I'm new here, don't know about many rules of the forum so sorry in advance.


I found the custom mime is not working and also, the _file_mime_type() not working correctly.

Basically if i upload any apk file then the mime should be "application/vnd.android.package-archive" but program returning only "application/zip". Maybe i'm wrong(i know that this wonderful framework is developed by the best php experts around the globe) but please help me to understand how i can deal with it.

I started debugging and landed on this function. Here is the code:

      if (function_exists('finfo_file'))
      { 
         $finfo = @finfo_open(FILEINFO_MIME);
         if (is_resource($finfo)){
            $mime = @finfo_file($finfo, $file['tmp_name']);
            finfo_close($finfo);

            if (is_string($mime) && preg_match($regexp, $mime, $matches))
            {
               log_message('error', json_encode([$mime, $matches,$matches[1]]));
               $this->file_type = $matches[1];
               return;
            }
         }
      }
Reply


Messages In This Thread
upload library processing with wrong mime type - by hemantmudgil - 05-01-2019, 02:42 PM



Theme © iAndrew 2016 - Forum software by © MyBB