Welcome Guest, Not a member yet? Register   Sign In
$mp3config['encrypt_name'] = TRUE not encoding?
#31

[eluser]stevenazari[/eluser]
this is a live site so how can I do it without being obtrusive to the members, I don't see this error so when I upload everything goes through fine. - I would need to send an email to myself right?

if I put a list of tmp files into an array, then do the !is_file statement, I can email myself what should be expected with the bandtrackupload variable and compare it to the tmp folder list? but is the file moved before or after the codeigniter upload configuration setup?

Code:
//Should I create tmp_folder array here?
$mp3config['upload_path'] = './media/audio/';
$mp3config['allowed_types'] = 'mp3|MP3';
$mp3config['max_size'] = '0';
$mp3config['encrypt_name'] = TRUE;
$mp3config['remove_spaces'] = TRUE;
$this->upload->initialize($mp3config);

//Or should I do it by here?

$this->upload->do_upload('bandtrackfile');
$bandtrackupload = $this->upload->data();
$date = time();

//Or should I do it by here??
                
// Do S3 audio/mpeg
if (!is_file($bandtrackupload['full_path']))
//and then send myself an email here...?
//I like turtles.
?
#32

[eluser]rogierb[/eluser]
I would generate the list twice, once before initializing and once after. Maybe even a third time just before you send the email. Better save then sorry:-)

For reference, you can send the output of $_FILES aswell
#33

[eluser]stevenazari[/eluser]
ok got my first bunch of emails:

Code:
a band failed to upload their track:

Files Error:
0

Codeigniter Error:
<p>The filetype you are attempting to upload is not allowed.</p>

Bandtrackupload Array:
print_r (Array)

        Date Uploaded: 1255486821

Bandtrackfile Array:
print_r (Sunshine No Intro.mp3)

with the bandtrackupload array - how do I get the array printed out in a EOF environment?

this is the predominant error message I get.

so what we can take from this is that there is no php error, the file is going to the temp file with no problems but the file then fails the codeigniter validation.

What I don't understand is why is it saying invalid filetype when the code has:

Code:
$mp3config['allowed_types'] = 'mp3|MP3';

any ideas? Would moving that line to the bottom of the config setup help? I've done that anyway and see what I get but any suggestions would be greatly appreciated
#34

[eluser]rogierb[/eluser]
Can you post the mimes.php (only the mp3/MP3part :-))

It should include at least include
.mp3 audio/mpeg3
.mp3 audio/mpeg
.mp3 audio/x-mpeg-3
#35

[eluser]stevenazari[/eluser]
where will I find that.... lol will it be in the server files (like php.ini) or codeigniter directory?

**edit found in the config folder hehe
#36

[eluser]stevenazari[/eluser]
Code:
'mid'    =>    'audio/midi',
'midi'    =>    'audio/midi',
'mpga'    =>    'audio/mpeg',
'mp2'    =>    'audio/mpeg',
'mp3'    =>    array('audio/mpeg', 'audio/mpg'),

ok so should I change that to

Code:
'mid'    =>    'audio/midi',
'midi'    =>    'audio/midi',
'mpga'    =>    'audio/mpeg',
'mp2'    =>    'audio/mpeg',
'mp3'    =>    array('audio/mpeg', 'audio/mpg', 'audio/mpeg3', 'audio/x-mpeg3'),
?

**edit**
I uploaded the file with the above edit and still got an email saying someone got an error Sad what am I doing wrong? Sad
#37

[eluser]rogierb[/eluser]
Just to make sure, you specified mp3|MP3. Change that to just mp3 since the upload class changes it to lower case and then you got 2 the same allowed types.

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

Maybe you can add the output of the preg_replace to your logging and see if it spits out anything unusual.
#38

[eluser]stevenazari[/eluser]
ok I changed it back to just mp3 but would that make a difference because I thought it would search "mp3 or MP3"

not sure what line I would write to output the preg_replace?

thanks for the help dude
#39

[eluser]rogierb[/eluser]
lol,

How about
Code:
echo 'My file extension is: |', preg_replace("/^(.+?);.*$/", "\\1", $_FILES['your_file_field']['type']),'|';

;-)




Theme © iAndrew 2016 - Forum software by © MyBB