How to store csv file to the database in cake php by coding

function admin_exceladd(){ if (!empty($this->data)) { if(is_uploaded_file($this->data[‘Webshop’][‘excelfile’][‘tmp_name’])){ move_uploaded_file($this->data[‘Webshop’][‘excelfile’][‘tmp_name’], ‘img/files/’.$this->data[‘Webshop’][‘excelfile’][‘name’]); $file = ‘img/files/’.$this->data[‘Webshop’][‘excelfile’][‘name’]; $handle = fopen($file, “r”); // read the 1st row as headings $header = fgetcsv($handle); // read each data row in the file $i = 0; // for the message…

Uploading files

CREATE TABLE my_files ( id INT(11) NOT NULL AUTO_INCREMENT, name VARCHAR(75) NOT NULL, type VARCHAR(255) NOT NULL, size INT(11) NOT NULL, data MEDIUMBLOB NOT NULL, created DATETIME, modified DATETIME, PRIMARY KEY (id) ); // app/models/my_file.php class MyFile extends AppModel {…