php - upload multiple images using symfony -
i'd upload lot of photos htmlto symfony server. don't know why doesn't work.
<form method="post" action="/api/photographer/photos/up"> <span class="btn btn-default btn-file"> selecciona tus fotos <input id="photos" idenctype="multipart/form-data" type="file" name="photos[]" multiple="multiple" > </span> <button id="uploader" class="btn btn-primary" type="submit"> <i class="fa fa-cloud-upload"></i> súbelas al servidor </button> </form>
symfony:
function upphotosaction(request $request){ $photos = $request->files->get('photos'); var_dump($photos); return "ok"; }
does know what's wrong?
add enctype="multipart/form-data"
form attribute:
<form method="post" action="/api/photographer/photos/up" enctype="multipart/form-data">
Comments
Post a Comment