Código PHP:
echo "<div class='col-xs-12 col-sm-6 col-md-6'>";
echo "<h3><span class='label label-info'>DATOS NUEVOS</span></h3>";
echo "<div class='well well-sm'>";
echo "<div class='row'>";
echo "<div class='col-sm-12 col-md-12'>";
echo "<textarea name='obsart' class='form-control' rows='6'></textarea>";
echo "</div>";
echo "</div>";
echo "<div class='row'>";
echo "<div class='col-sm-12 col-md-12'>";
echo "<h4 align='center'><span class='label label-primary'>ADJUNTAR FOTO</span></h4>";
echo "<input id='nom-foto' name='nom-foto' type='file' accept='image/*' class='file-loading' > ";
echo "</div>";
echo "</div>";
echo "</div>";
echo "</div>";
echo "</div>";
Código PHP:
<script>
$(document).on('ready', function() {
var fotarti = "";
$("#nom-foto").fileinput({
uploadUrl: 'sube_modartic-nw.php',
dropZoneEnabled: false,
previewFileType: "image",
allowedFileExtensions: ["jpg", "gif", "png"] ,
browseClass: "btn btn-success",
browseLabel: "Selecciona",
browseTitle: "Selecciona la foto",
browseIcon: "<i class=\"glyphicon glyphicon-picture\"></i> ",
removeClass: "btn btn-danger",
removeLabel: "Borrar",
removeTitle: "Anula foto seleccionada",
removeIcon: "<i class=\"glyphicon glyphicon-trash\"></i> ",
uploadClass: "btn btn-info",
uploadLabel: "Grabar",
uploadTitle: "Graba la foto seleccionada",
uploadIcon: "<i class=\"glyphicon glyphicon-upload\"></i> ",
previewClass: "bg-warning",
initialCaption: "Selecciona la foto",
uploadExtraData: {nomfoto: fotarti}
});
});
</script>
¿cómo puedo pasar el nombre de la foto seleccionada con el botón submit del formulario (método POST)?