I am using multiple file upload for this blueimp plugin demo, doc
They are given file upload by the AJAX file. But, I dont need to upload by Ajax. I need $_FILES details in same page while form submitting.
I have tried following code:
<form id="fileupload" action="" method="POST" enctype="multipart/form-data">
<div class="row fileupload-buttonbar">
<div class="col-lg-7">
<span class="btn btn-success fileinput-button">
<i class="glyphicon glyphicon-plus"></i>
<span>Add files...</span>
<input type="file" name="files[]" multiple>
</span>
<button id='subtest' type="submit" class="btn btn-primary start">
<i class="glyphicon glyphicon-upload"></i>
<span>Start upload</span>
</button>
</div>
</div>
</form>
<script>
$('#subtest').click(function() {
$('#fileupload').submit();
});
</script>
PHP Script:
<?php
if(isset($_POST)) {
print_r($_FILES);
}
?>
I got following $_FILES result while submitting the form.
Array
(
[files] => Array
(
[name] => Array
(
[0] =>
)
[type] => Array
(
[0] =>
)
[tmp_name] => Array
(
[0] =>
)
[error] => Array
(
[0] => 4
)
[size] => Array
(
[0] => 0
)
)
I dont know why result become likes above. (UPLOAD_ERR_NO_FILE Value: 4; No file was uploaded).
Help me... Thanks in advance.