php - CodeIgniter uploading files -



php - CodeIgniter uploading files -

i strugling upload files codeigniter. doing wrong, can 1 explain me file premision, , how alter on windows. should set folder upload files or patent folders. code in form

<div id="contact_box"> <form id="form" enctype="multipart/form-data" name="form" action="<?php echo site_url('admin/clients/add_client');?>" method="post" > client name: </br><input type="text" name="name" id="name"/> </br></br> logo: <input type="file" name="file" id="file"/> </br></br> <input type="submit"/> </form> </div>

and controller

$this->load->library('upload'); $config['upload_path'] = './att/'; $config['allowed_types'] = 'png|jpg|bmp'; $this->upload->initialize($config); $upload = $this->upload->do_upload();

i dont know doing wrong should ajdust htaccess file?

$config['upload_path'] = './att/';

is maybe line wrong att folder kid of codeigniter folder should check file premison. add together folder total control. in controller result when print_r $_files['file']['name'], how nil in folder???

try this:

$this->upload->do_upload('file'); #the field name of file trying upload

php codeigniter upload

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -