I want to upload files with ajax.
I have tried dropzone and ajaxupload, but both libraries are not working.
So I tried to do it on my own. Here is my input type file code:
<input id="le_images" class="form-control" type="file" name="images[]" multiple>
and here is my jQuery code
$('#le_images').change(function(){
var file_data = $(this).prop("files");
$.ajax({
url:"upload.php",
type:'POST',
data:{
'file' : file_data
},
success:function(results){
}
});
});
Now I am sending this files on upload.php
with above code. But I did not receive this. Can you tell me where am I wrong?
So can you guys suggest me how to do this?