Código
</a> <div class="myFormUpdate"> <form th:action="@{/producto/guardar}" method="POST" class="form_content" enctype="multipart/form-data"> <div class="modal fade" th:id="updateModal+${producto.codigo}" id="updateModal" tabindex="-1" role="dialog" aria-labelledby="updateModalLabel" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h4 class="modal-title" id="updateModalLabel">Update Producto</h4> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> </button> </div> <div class="modal-body"> <div class="form-group"> <!--<label for="id" class="col-form-label">User id:</th:text></label>--> <input type="hidden" class="form-control" id="id" th:name="codigo" th:value="*{producto.codigo}" /> </div> <div class="form-group"> <input type="text" class="form-control" id="titulo" th:name="nombre" th:value="*{producto.nombre}" /> </div> <div class="form-group"> <input type="text" class="form-control" id="marca" th:name="marca" th:value="*{producto.marca}"> </div> <div class="form-group"> <input type="number" class="form-control" id="precio" th:name="precio" th:value="*{producto.precio}" step="any"> </div> <div class="form-group"> <input type="text" class="form-control" id="descripcion" th:name="descripcion" th:value="*{producto.descripcion}" /> </div> <div class="form-group"> <input type="number" class="form-control" id="fecha" th:name="stock" th:value="*{producto.stock}" /> </div> <div class="form-group"> <img width="100px" class="card-img-top m-auto" th:src="*{'data:image/png;base64,'+producto.imagen}"> <label for="file" class="bttn"> Subir archivo </label> <input type="file" name="file" class="form-control-file" id="imagen" th:name="file" accept="image/x-png,image/gif,image/jpeg,image/png,image/jpeg" style='display: none;'> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> <input type="submit" class="btn btn-primary" value="Save" /> </div> </div> </div> </div> </form>