I have the following form:
<form id="MainForm" enctype="multipart/form-data" method="post" action="index.php">
<input type="file" name="file" id="file" class="upload" onchange="document.getElementById('MainForm').submit();" title="Go!" accept="image/*">
</form>
And in the beginning of the same page, in the php:
if(isset($_POST['file']))
{
echo 'ok'; // and do stuff latter
}
The idea is to send the file when I select it, without having to press any kind of submit button, but its not echoing ok. When I change my form method to get, and put $_GET instead of $_POST it echoes ok, but I need to do it with post and I couldn't figure out what I'm missing yet.