I want to use the easiest method for uploading file through jquery ajax.
My code is:
<body>
<form action="?" method="POST" enctype="multipart/form-data">
<input type="file" name="myfile" /><br>
<input type="submit" name="submit_btn" value="Submit" />
</form>
<div>
<?php
if (isset($_POST['submit'])) {
//move_uploaded_files()...
}
?>
</div>
</body>
That's because GET requests don't have a body, and that's where files would go