I’m working on this multiple upload script and it works just fine except for each new upload image I start it appends the file after the last one… I would like it to show as the first one…
onSubmit: function(file, ext){
if (! (ext && /^(jpg|png|jpeg|gif)$/.test(ext))){
// If the ext. is not allowed
status.text('Only JPG, PNG or GIF files are allowed');
return false;
}
mynewLI = jQuery('<li></li>').appendTo('#files').html('<img src="modules/ajaxMultiUpload/waiting.gif" />').addClass('success');
jQuery('#files').data(file, mynewLI);
},
onComplete: function(file, response){
//Add the file to a list
var mynewLI = jQuery('#files').data(file);
if(response==="success"){
file = file.replace(/ /g,"-");
file = file.toLowerCase();
mynewLI.html('<img src="modules/ajaxMultiUpload/uploads/thumb_'+file+'" alt="" />').addClass('success');
} else if(response==="error1"){
mynewLI.html('Wrong dir...').addClass('error');
} else{
mynewLI.html('Something went wrong?<br><br>'+response).addClass('error');
//mynewLI.text(file).addClass('error');
}
}
Any ideas to how to do so?