Problem with PHPExcel joomla, no matter libraries and does not read the file

Topics: Developer Forum
Sep 9, 2014 at 4:50 PM
I want to get data from a csv or xls excel to make a massive load of employees in my mysql DB, but first show all records in a table. the project is in php with joomla ..

I tried this:


. include JPATH_SITE '/ libraries / simpleexcel / src / SimpleExcel / SimpleExcel.php';
JHTML :: addIncludePath (JPATH_SITE '/ libraries / excel / reader.php'.)


$ name = $ _POST ['name'];

Spreadsheet_Excel_Reader $ data = new ();
$ data-> setOutputEncoding ('CP1251');
$ data-> read ($ name);
echo ("<table>");
for ($ i = 1; $ i <= $ data-> sheets [0] ['numRows']; ++ $ i) {
 echo ("<tr>");
 for ($ j = 1, $ j <= $ data-> sheets [0] ['NumCols']; ++ $ j) {
     echo ("<td>" $ data-> sheets [0] ['cells'] [$ i] [$ j] "</ td>"..);
 }
 echo ("</ tr>");
}


but apparently no problem to import the library

nor recognizes this:

_FILES ['File'] ['name'] $
If anyone can help, thanks. !!


Probe that code but I have problem with the path of the file, I can not have. explain a little better, I'm working with joomla MVC in the view .. I have a form that I load a file, and from there sent the file name to the controller through ajax

js.ajax ({
    type: "POST"
    url: "index.php option = com_empresa & task = cargamasiva.mostrar"
    data: "name =" + js ("# jform_seleccione") val ().
    datatype: "application / json"
    success: function (data) {
alert ("I go js");
jQuery.parseJSON objData = var (data);
alert ("data" + data);
alert (objData.valores [4]);
if (objData.error == 1) {
procesarCarga ('jform_cargamasivaList' objData.valores);
alert ("came pa controller");
}
    },
    error: function (jqXHR, textStatus, errorThrown) {
     alert ("ajax error");
     alert (textStatus);
     alert (jqXHR);
     alert (errorThrown);
    }
    });
I alla receipt

$ name = $ _POST ['name'];
and here I want to read the file using the code shown above, but does not show me anything.

I've also tried to do it from my view but I can not read the file you select.
Coordinator
Sep 9, 2014 at 6:04 PM
This isn't a PHPExcel problem when you're using Spreadsheet_Excel_Reader