• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Upload filetype not allowed??

#30
[eluser]rainman[/eluser]
Do you have the proper rights on the hosted server for the tmp and upload file location?

In my case, I wasn't able to read the file in the tmp_location so the is_allowed_filetype was returning FALSE.

Since allowing (*) was a poor option, I adjusted the code slightly to ensure that I could still use the class. I'll have to go back and adjust a little more but, it works for me while testing in dev / production.
In the following function >> public function is_allowed_filetype
Here is the code snippet.
Code:
if (is_array($mime))
  {
   // updated this to check mime defined vs. file_type for now.
   /*
   if (in_array($this->file_type, $mime, TRUE))
   {
    return TRUE;
   }
   */
   if (in_array($ext, $mime, TRUE)) {
    return TRUE;
   }
  
  }

** In my case I was uploading a csv file. I updated my mimes array to include csv as part of the csv array. I'm going to go back and update this to if(array_key_exists) in the code above to tighten it up a bit.

Code:
$mimes = array( 'hqx' => 'application/mac-binhex40',
    'cpt' => 'application/mac-compactpro',
    'csv' => array('csv', 'text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain'),

In your case with uploading a sql script, this may and may not work for you... but, just in case.. figured it might help someone.



Messages In This Thread
Upload filetype not allowed?? - by El Forum - 02-16-2010, 02:49 AM
Upload filetype not allowed?? - by El Forum - 02-16-2010, 02:59 AM
Upload filetype not allowed?? - by El Forum - 02-16-2010, 03:21 AM
Upload filetype not allowed?? - by El Forum - 02-16-2010, 03:44 AM
Upload filetype not allowed?? - by El Forum - 02-16-2010, 03:48 AM
Upload filetype not allowed?? - by El Forum - 02-16-2010, 04:03 AM
Upload filetype not allowed?? - by El Forum - 02-16-2010, 04:49 AM
Upload filetype not allowed?? - by El Forum - 02-16-2010, 05:38 AM
Upload filetype not allowed?? - by El Forum - 02-16-2010, 07:05 AM
Upload filetype not allowed?? - by El Forum - 02-17-2010, 02:19 AM
Upload filetype not allowed?? - by El Forum - 02-17-2010, 02:29 AM
Upload filetype not allowed?? - by El Forum - 02-17-2010, 02:50 AM
Upload filetype not allowed?? - by El Forum - 02-17-2010, 02:57 AM
Upload filetype not allowed?? - by El Forum - 02-17-2010, 03:01 AM
Upload filetype not allowed?? - by El Forum - 02-17-2010, 04:16 AM
Upload filetype not allowed?? - by El Forum - 02-20-2010, 06:55 AM
Upload filetype not allowed?? - by El Forum - 02-22-2010, 08:11 AM
Upload filetype not allowed?? - by El Forum - 04-23-2010, 03:47 AM
Upload filetype not allowed?? - by El Forum - 06-29-2010, 11:43 AM
Upload filetype not allowed?? - by El Forum - 07-14-2010, 04:34 AM
Upload filetype not allowed?? - by El Forum - 07-14-2010, 05:41 AM
Upload filetype not allowed?? - by El Forum - 07-14-2010, 05:43 AM
Upload filetype not allowed?? - by El Forum - 07-14-2010, 05:46 AM
Upload filetype not allowed?? - by El Forum - 07-14-2010, 05:48 AM
Upload filetype not allowed?? - by El Forum - 07-14-2010, 05:50 AM
Upload filetype not allowed?? - by El Forum - 07-14-2010, 04:08 PM
Upload filetype not allowed?? - by El Forum - 07-14-2010, 04:53 PM
Upload filetype not allowed?? - by El Forum - 07-14-2010, 05:06 PM
Upload filetype not allowed?? - by El Forum - 08-11-2012, 12:31 PM
Upload filetype not allowed?? - by El Forum - 09-06-2012, 01:50 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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