Dradi7 gracias por responder
Código Javascript
:
Ver original<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.8.24/jquery-ui.min.js"></script>
<script language="javascript" src="js/AjaxUpload.2.0.min.js"></script>
Código Javascript
:
Ver original<script language="javascript">
$(document).ready(function(){
var button = $('#upload_button'), interval;
new AjaxUpload('#upload_button', {
action: 'upload.php',
onSubmit : function(file , ext){
if (! (ext && /^(jpg|png|jpeg|gif)$/.test(ext))){
// extensiones permitidas
alert('Error: Solo se permiten imagenes');
// cancela upload
return false;
} else {
button.text('Uploading');
this.disable();
}
},
onComplete: function(file, response){
button.text('Upload');
// enable upload button
this.enable();
// Agrega archivo a la lista
$('#lista').appendTo('.files').text(file);
$('#ruta').val("uploads/"+file)
$('a').attr('href',"uploads/"+file);
}
});
});
</script>
Código HTML:
Ver original
<input name="" type="button" id="upload_button" value="Subir Imagen"/> <!--<a href="">Ver Imagen</a>-->
<input type="text" id="ruta"/>