I have been trying to upload multiple images in Laravel 4, using jQuery & Ajax without the page refreshing, with the progress bar, remove button and review (display the uploaded thumbnail where remove deletes it from the DB).
I have taken many approaches, (http://packalyst.com/packages/package/sukohi/surpass) (despite following every step, still doesn't work). Another approach I used (https://gist.github.com/filip-adriginal/bd397c5ec22a5916a966#file-gistfile1-txt) and tried the jQuery-File-Upload.
I am able to upload multiple images using (using foreach in the Controller):
{{ Form::file('image[]', array('multiple'=>true)) }}
I have also looked at videos, tutorials and blogs, but they either had partial information or unsolved problems.
If anyone could give me some sample code, or point me in the right direction, that would be great! Thanks everyone for any help, really appreciate it.
code
<script> var form = document.querySelector('#ajax'); var request = new XMLHttpRequest(); form.addEventListener('submit',function(e) { e.preventDefault(); var formdata = new FormData(form); request.open('post', 'submit'); request.send(formdata); }, false); </script>code
Now I am getting a 405 MethodNotAllowedHttpException – Filip Nikolic Feb 23 at 20:37