Welcome Guest, Not a member yet? Register   Sign In
another uploading
#1

[eluser]wildcard99[/eluser]
hello guys... ive searched all over the forum but it seems that no one suites my problem.

Im trying to upload a wav file using the upload class but it always says that im not uploading the proper file type.. Ive checked the returned mime type and it exist in the mime.php under config folder.. anyone help please!
#2

[eluser]Sean Murphy[/eluser]
Have you set the allowed_types configuration variable?

http://ellislab.com/codeigniter/user-gui...ading.html
Code:
function do_upload()
{
    $config['upload_path'] = './uploads/';
    $config['allowed_types'] = 'gif|jpg|png|wav';
    $config['max_size']    = '100';
    $config['max_width']  = '1024';
    $config['max_height']  = '768';
    
    $this->load->library('upload', $config);

    if ( ! $this->upload->do_upload())
    {
        $error = array('error' => $this->upload->display_errors());
        
        $this->load->view('upload_form', $error);
    }    
    else
    {
        $data = array('upload_data' => $this->upload->data());
        
        $this->load->view('upload_success', $data);
    }
}
#3

[eluser]wildcard99[/eluser]
Yes done that.... any other idea?
#4

[eluser]tonanbarbarian[/eluser]
maybe post your code so that others can see if they can see an issue with it
#5

[eluser]wildcard99[/eluser]
It's fine now... I can upload wav files.. tnx guys...
#6

[eluser]TiBe[/eluser]
I think you should post your solution, so if there's someone else with the same problem you could help him..
#7

[eluser]wildcard99[/eluser]
oh sorry.. Ive found out that in my mime types under config folder.. it says 'wav' => 'audio/wav-x',

I modified it into 'wav' => array('audio/wav', 'audio/wav-x') and everthing went fine. =)




Theme © iAndrew 2016 - Forum software by © MyBB