Welcome Guest, Not a member yet? Register   Sign In
I can not download the files on a server
#1

[eluser]Unknown[/eluser]
Hello! torment a problem - I can not download the files on a server - gives error "You did not select a file to upload.". What's the problem I do not understand.
here's the code:
Code:
function save1(){
$config['upload_path'] = './img_company/';            
                    $this->load->library('upload', $config);
            
                    if ( ! $this->upload->do_upload())
                    {  
                      echo     $this->upload->display_errors();
                        
                    }
                    else
                    {
                       echo  $this->    upload->    data();
                        
                    }
}
#2

[eluser]CroNiX[/eluser]
What does your form look like?
#3

[eluser]Unknown[/eluser]
my form is requested with "serialize()"
#4

[eluser]CroNiX[/eluser]
According to the docs, the file input must have the name of "userfile". If it doesn't, you need to explicitly set the name you used in the upload config.

I don't know what you mean by "requested with serialize()". The code you posted doesn't show using serialize() and I can only go by what you showed.
#5

[eluser]jonez[/eluser]
Are you trying to upload files through AJAX using jQuery's serialize method on the form? If you are that won't work. Check this plugin out for a solution: http://cmlenz.github.io/jquery-iframe-transport/

If you don't need to support older browsers (IE10+) you can do AJAX uploads using pure JS through the FileReader API in HTML5.




Theme © iAndrew 2016 - Forum software by © MyBB