Welcome Guest, Not a member yet? Register   Sign In
Mp3 Mime-type?
#21

[eluser]markanderson993[/eluser]
Awesomeness Fuzzy, the log is functioning correctly! Now we just wait for these troublesome individuals to give us some data. Thanks for all the code!
#22

[eluser]TheFuzzy0ne[/eluser]
No problem. Sorry about the hassle I caused getting it to work.
#23

[eluser]Tobz[/eluser]
Hi guys,

this is a nice function you've been working on.
here is my 2cents input:

change:
Code:
# START EDIT #
$log_file = BASEPATH . 'logs/unknown_mimes.log';

to

Code:
# START EDIT #
$CI =& get_instance();
$log_file = $CI->config->item('log_path').'unknown_mimes.php';

this will save the log file into the correct location set by the config file.


edit:

also change the .log extension to .php and add first line to make it none readable via the web
Code:
if (file_exists($log_file)) {
  ...
}
else {
  $file_type = "<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?>\n\n".$file_type;
}
#24

[eluser]TheFuzzy0ne[/eluser]
Thanks for your input. You're right, we should have done that from the start, however, this was a quick and dirty fix just so we could see what mime types should be supported but aren't. The class extension will be removed soon, if it hasn't been already. The htaccess file should prevent any unauthorised access to the file.
#25

[eluser]Tobz[/eluser]
good point. I think I'll leave it in there to log what files people are trying to upload.

going back to the put on this post, have you guys figured out why you can't upload mp3s yet?
I'm a bit stuck on this right now.

Cheers

UPDATE:

I've checked the mime-type being sent, and it matches what is in the mimes file but it still says: The filetype you are attempting to upload is not allowed.

grrr
#26

[eluser]TheFuzzy0ne[/eluser]
As far as I know, it's sorted, yes, but if you're having problems, please start a new topic. It just makes it easier to keep a track of what's going on.
#27

[eluser]Tobz[/eluser]
aha this is for both this function and also fixed my problem.

you must trim " from $this->file_type, the $mimes array does not have the quotes.
Code:
if (is_array($mime)) {
  if (in_array(trim($this->file_type,'"'), $mime, TRUE)) {
     return TRUE;
  }
}
else ...




Theme © iAndrew 2016 - Forum software by © MyBB