Reputation: 786
This is my form in wich I'm asking for a file:
<form action="controllers/controller-Product.php?action=import" method="post" enctype="multipart/form-data">
Select your CSV File<br/>
<input type="file" name="file"/>
<input type="submit" value="Continue to import"/>
</form>
In the action (controller-Product.php) I have this line of code:
var_dump($_FILES);
If I choose a JPG or a PNG or even a PDF file, it shows me all its properties.
When I choose a CSV file, it just ignores it and the var_dump function returns an empty array.
Any ideas why the CSV File is being ignored?
IMPORTANT; EDIT What I'm showing here are two files, the one that contains the HTML form and the action file which only contains that line of PHP code. There are those two files only and there is no more code doing anything before the var_dump() line. All these files are as raw as you see here.
Upvotes: 2
Views: 469
Reputation: 786
Silly problem solved:
In the PHP.INI file you gotta search for:
post_max_size = 3M
And change it's default value
Instead of
upload_max_filesize = 64M
The file I was trying to upload in CSV format was more than 3MB, that's why the server was ignoring it.
Upvotes: 3