Upload file * .xls generates null, instead * .xlsx works correctly

0

A simple form to select a file.

<form role="form"  method="POST" action="procesaExcel.php" enctype="multipart/form-data">

         <input type="file" id="inputXML" name="inputExcel" >
         <button type="submit" class="btn btn-primary">Subir</button>

</form>

Now the php file that processes the form.

<?php
      var_dump($_FILES["inputExcel"]["tmp_name"]);
?>

The problem is that when I upload a file with the extension * .xlsx the php file reads the content, but if the extension is * .xls what I get is null.

I have looked a bit at the types of codes for the forms:

.xls  - application/vnd.ms-excel
.xlsx - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

And it does not work with either of them.

Has anyone had a similar problem?

    
asked by nachfren 21.09.2016 в 12:42
source

1 answer

0

Well, the error was due to the size that allowed in the file php.ini exactly the line ordered is: upload_max_filesize = 1024M .

    
answered by 21.09.2016 в 13:32