![]() |
how to upload file with CI? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: how to upload file with CI? (/showthread.php?tid=33072) |
how to upload file with CI? - El Forum - 08-14-2010 [eluser]Unknown[/eluser] I already did on the tutorial but it show this message please help? "The upload path does not appear to be valid." where is my code in controller/upload.php <?php class Upload extends Controller { function Upload() { parent::Controller(); $this->load->helper('html'); $this->load->helper('form'); $this->load->helper('url'); $this->load->library('upload'); } function index() { $link = array( 'href'=>'system/application/views/themes/Sky/sky_css.css', 'rel'=>'stylesheet', 'type'=>'text/css' ); $data['link_css']=link_tag($link); $icon=array( 'href'=>'system/application/views/themes/Sky/Cresittel.ico', 'rel'=>'shortcut icon', 'type'=>'image/ico' ); $data['myicon']=link_tag($icon); $data['title']='Uploading file with CodeIgniter Framework'; $data['Heading']='Upload file'; $image_properties = array( 'src' => 'system/application/views/themes/Sky/logo.jpg', 'alt' => 'www.cresittel.com', 'class' => 'header-weaper', 'title'=>'http://www.cresittel.com' ); $data['myimg']=img($image_properties); $data['error']=''; $this->load->view('Upload_view',$data); } function do_upload() { $link = array( 'href'=>'system/application/views/themes/Sky/sky_css.css', 'rel'=>'stylesheet', 'type'=>'text/css' ); $data['link_css']=link_tag($link); $icon=array( 'href'=>'system/application/views/themes/Sky/Cresittel.ico', 'rel'=>'shortcut icon', 'type'=>'image/ico' ); $data['myicon']=link_tag($icon); $data['title']='Uploading file with CodeIgniter Framework'; $data['Heading']='Upload file'; $image_properties = array( 'src' => 'system/application/views/themes/Sky/logo.jpg', 'alt' => 'www.cresittel.com', 'class' => 'header-weaper', 'title'=>'http://www.cresittel.com' ); $data['myimg']=img($image_properties); $data['error']=''; $config['upload_path'] = "./system/"; $config['allowed_types'] = 'gif|jpg|png|jpeg'; $config['max_size'] = '2048'; $config['max_width'] = '1024'; $config['max_height'] = '768'; $this->load->library('upload', $config); if ( ! $this->upload->do_upload()) { $data['error'] = $this->upload->display_errors(); $this->load->view('upload_view', $data); } else { $data = array('upload_data' => $this->upload->data()); $data['Heading']='Upload File successful '; $this->load->view('upload_success_view', $data); } /* $this->load->library('Multi_upload'); $files=$this->multi_upload->go_upload(); if ( ! $files ) { $data['error'] = $this->upload->display_errors(); $this->load->view('Upload_view', $data); } else { $data = array('upload_data' => $files); $data['Heading']='Upload File successful '; $this->load->view('upload_success_view', $data); } */ } } ?> how to upload file with CI? - El Forum - 08-15-2010 [eluser]SitesByJoe[/eluser] Did you allow write permissions for the folder you want to upload to? how to upload file with CI? - El Forum - 08-16-2010 [eluser]Jan_1[/eluser] maybe try the whole serverpath, not just the CI-path |