php - MySQL LOAD DATA INFILE not working on Online Server -
i'm trying upload csv data file mysql. works fine on wamp localhost when upload online server, fails error can't find csv file.
//code in model public function uploadcontactsfromcsvfile($filename) { $query = <<<eof load data infile '$filename' table all_contacts fields terminated ',' optionally enclosed '"' lines terminated '|' (id,fullname,contact) eof; $this->db->query($query); } //code in controller public function uploadcontactsfromcsvfile() { $this->load->helper(array('form', 'url')); $config = array( 'upload_path' => "./contacts_uploads/", 'allowed_types' => "csv", 'overwrite' => true, ); $this->load->library('upload', $config); if ($this->upload->do_upload()) { $upload_data = $this->upload->data(); $agreement_file = $upload_data['file_name']; $file_name=$_files["userfile"]["name"]; $csvfile="http://broadbordershousingcoop.com/corporate-sms/contacts_uploads/"."$file_name"; echo $csvfile; $this->smskingmodel->uploadcontactsfromcsvfile($csvfile); return $agreement_file; } else { return $file_name = null; } }
kindly assist.
Comments
Post a Comment