Sempervivum
Erfahrenes Mitglied
- Der Pfad uploads/dateien/ existiert, ausgehend von dem Verzeichnis wo die beiden Dateien liegen?
- Du testest auf einem Webserver mit PHP?
error
Type: Function( jqXHR jqXHR, String textStatus, String errorThrown )
A function to be called if the request fails. The function receives three arguments: The jqXHR (in jQuery 1.4.x, XMLHttpRequest) object, a string describing the type of error that occurred and an optional exception object, if one occurred. Possible values for the second argument (besides null) are "timeout", "error", "abort", and "parsererror". When an HTTP error occurs, errorThrown receives the textual portion of the HTTP status, such as "Not Found" or "Internal Server Error." As of jQuery 1.5, the error setting can accept an array of functions. Each function will be called in turn
Code:
<script>
$(document).ready(function(){
$('#uploadForm').submit(function(e){
if($('#uploadFile').val()){
e.preventDefault()
$('#loader-icon').show()
$(this).ajaxSubmit({
target: '#targetLayer',
beforeSubmit: function(){
$('.progress-bar').width('0%');
},
uploadProgress: function (event, position, total, percentComplete){
$('.progress-bar').width(percentComplete + '%');
$('.progress-bar').html('<div id="progress-bar-status">' + percentComplete +' %</div>')
},
success: function(){
$('#loader-icon').hide();
$('#progress').hide();
},
error: function(jqXHR, textStatus, errorThrown) {
console.log(jqXHR, textStatus, errorThrown);
},
resetForm: true
});
return false;
}
});
});
</script>