Welcome Guest, Not a member yet? Register   Sign In
File extension problem with upload
#11

[eluser]shinokada[/eluser]
Is your other controller which has session working?

Have you autoloaded session library?
#12

[eluser]shinokada[/eluser]
This line is messed up.
You are doing do_upload ('file_name') when you are checking $_FILES['icon'].


Code:
if (strlen($_FILES['icon']['file_name'])){
                        if(!$this->upload->do_upload('file_name')){

They should have the same.
#13

[eluser]maria clara[/eluser]
the session is loaded. what do you mean by
Quote:You are doing do_upload (‘file_name’) when you are checking $_FILES[‘icon’].


if (strlen($_FILES['icon']['file_name'])){
if(!$this->upload->do_upload('file_name')){
#14

[eluser]shinokada[/eluser]
See my original code.
Code:
if (strlen($_FILES['image']['name'])){
            if(!$this->upload->do_upload('image')){
                $this->upload->display_errors();


$_FILES['image'] and do_upload('image') has the same ['image'].

But yours don't. They should be the same.
#15

[eluser]John Pantoja[/eluser]
any reason why you're strlen'n the filename? If it's to see if the file was uploaded successfully you should check ['error'] (or is is errors?]
#16

[eluser]maria clara[/eluser]
i don't have an error now but in the field 'icon', it shows "0" even if i uploaded an image.




Theme © iAndrew 2016 - Forum software by © MyBB