1

Im doing Load Data Infile I've got this code

 move_uploaded_file($file_temp,"uploads/master_listing/".$file_name);

 $file_path = FCPATH.'/uploads/master_listing/'.$file_name;

 $this->db->query("LOAD DATA LOCAL INFILE '".$file_path."' 
   INTO TABLE fsi_temp_newmasterlist 
   FIELDS TERMINATED BY ','
   LINES TERMINATED BY '\\n' 
   IGNORE 1 LINES
   (SEQUENCENUMBER,NAME,ADDRESS,PICKUPDATE,ENCODERNO,BARCODEVALUE,REMARKS,CLIENT,PROD)
 ");

I dont know what's wrong in that code I got error Can't find file

Here's my file location myfolder/uploads/master_listing/

My csv file has table head of SEQUENCENUMBER,NAME,ADDRESS,PICKUPDATE,ENCODERNO,BARCODEVALUE,REMARKS,CLIENT,PROD

I really need help.. thanks in advance.

Joel Enanod Jr
  • 649
  • 9
  • 19

1 Answers1

2

use this

$new_name = str_replace("\\","/",$file_path)

after replace

C:/xampp5.5/htdocs/joel_fsi/fsi2/uploads/master_listing/testfileupload.csv

In your code

 C:\xampp5.5\htdocs\joel_fsi\fsi2/uploads/master_listing/testfileupload.csv

They are conflict \ and /

Take look at this Codeigniter path functions definitions

Community
  • 1
  • 1
Abdulla Nilam
  • 36,589
  • 17
  • 64
  • 85