Welcome Guest, Not a member yet? Register   Sign In
how do you know the extension of the browsed file
#1

[eluser]NEHIL[/eluser]
When you are uploading an image, you pass a config array. this is how mine looks like

Code:
$config = array(
            'allowed_types' => 'jpg|jpeg|gif|png',
            'upload_path' => $this->gallery_path,
            'file_name' => '$filename'
        );
$this->load->library('upload',$config);
$this->upload->do_upload();

So know, knowing the fact that i have allowed so many types while giving the file_name i don't know what extension to put?
please help! :roll:
#2

[eluser]LuckyFella73[/eluser]
Hi NEHIL,

watch out for "$this->upload->data()" in the User-Guide:
http://ellislab.com/codeigniter/user-gui...ading.html

It gives you an array with much info about the uploaded file.
#3

[eluser]NEHIL[/eluser]
doen't give info of the file after the upload is done? I need the seeting before the upload so that the filename can be saved
#4

[eluser]LuckyFella73[/eluser]
Quote:... while giving the file_name i don’t know what extension to put?

Take a few seconds to read the user guide like suggested then you know
how to get the file-extention of the uploaded file. I guess the filename
without the extention is not your problem.




Theme © iAndrew 2016 - Forum software by © MyBB