I'm trying to do a simple HTML file upload.
<form accept-charset="utf-8" name="gallery" method="POST" action="/gallery">
<input type="hidden" name="_token" value="fQ7arteCHmBFVfvQARWxxK3dXNgUJF40FdsaD3R">
<label class="btn btn-default">
Browse <input type="gallery[]" hidden multiple>
</label>
</form>
I've traced it with Xdebug and I can see that $request->gallery shows an array of file names but the file count is still zero:
if (!$request->files->count()) {
return redirect()->back()->with('error', 'Empty file list.');
}
The PHP global variable $_FILES is also empty.
This works fine when submitted over AJAX using something like Dropzone.js, but when I do it using a standard HTML5 form element it doesn't work.
Feel like I'm missing something obvious here.
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2sOzT2i
via IFTTT
Aucun commentaire:
Enregistrer un commentaire