Ошибка загрузки картинки скрипта Klamo

adrian219855

New member
Joined
Mar 9, 2020
Messages
0
Reaction score
0
Ниже приведен файл add.php. Где может быть ошибка? Загружайте фотографии, но не отображайте их.

Code:
<script>
var uploadedPhotos=<?php echo $uploadedPhotos; ?>;
var maxPhotos=<?php echo $maxPhotos; ?>;
var uploadErrors=[];
$(function(){
sortablePhotos($('#apid').val());
$("#photoUploader button").keydown(function(e){
if(e.keyCode===13){
e.preventDefault();
}
});
$('#uploaderButton').fileupload({
dataType: 'json',
change:function (e, data){
$('#photoUploader .add-photo-button:visible').not('.upload-working').slice(0, data.files.length).find('i').removeClass('hidden');
$('#photoUploader .add-photo-button:visible').not('.upload-working').slice(0, data.files.length).find('span').addClass('hidden');
$('#photoUploader .add-photo-button:visible').not('.upload-working').slice(0, data.files.length).addClass('upload-working');
uploadErrors=[];
},
done:function (e, data){
var item=data.result;
if(item.status=='success'){
uploadedPhotos=uploadedPhotos+1;
var new_photo=$('#photoUploaderTemplate').clone();
new_photo.removeAttr('id');
new_photo.removeClass('hidden');
new_photo.find('img').attr('src', item.file);
new_photo.find('.rotate-photo').click(function(){
rotateUploadedPhoto($('#apid').val(), item.key);
});
new_photo.find('.delete-photo').click(function(){
deleteUploadedPhoto($('#apid').val(), item.key);
});
new_photo.attr('id', 'photo_'+item.key);
$('#photoUploader .add-photo-button').eq(0).before(new_photo);
$('#photoUploader .add-photo-button.upload-working:visible').slice(0, 1).addClass('hidden');
} else {
uploadErrors.push('<p><b>'+item.original+':</b><br>'+item.errors.file+'</p>');
}
$('#photoUploader .add-photo-button.upload-working').slice(0, 1).find('i').addClass('hidden');
$('#photoUploader .add-photo-button.upload-working').slice(0, 1).find('span').removeClass('hidden');
$('#photoUploader .add-photo-button.upload-working').slice(0, 1).removeClass('upload-working');
$('#photoUploader .add-photo-button').removeClass('first');
$('#photoUploader .added-photo').removeClass('first');
$('#photoUploader .added-photo').first().addClass('first');
$('#pre_upload_info').addClass('hidden');
$('#post_upload_info').removeClass('hidden');
sortablePhotos($('#apid').val());
},
stop:function (e, data){
if(uploadErrors.length>0){
$('#uploadErrors .window-message').html(uploadErrors.join(''));
$.fancybox({'type':'inline', 'href':'#uploadErrors', 'closeBtn':false, helpers:{overlay:{locked:false}}});
}
}
});
});
</script>
 
Back
Top