0
Click to load the image, send the image file to the UPLOADS folder, but do not return after sending the minuature, but when you click F5 the image loads, which can be ?
Add.php
<input type="file" class="hidden" id="uploaderButton" name="file" data-url="<?php echo $langPrefix; ?>/ajax/upload/?apid=<?php echo $apid; ?>" multiple>
<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>
Take a look at the browser element inspector in the div where the thumbnail is displayed after uploading to see what it shows, if there is any class that hides the image, or if the image is there but is hidden etc.
– Sam
Interesting: when I delete folders created within UPLOADS, the first thumbnail image appears normally.
– Anderson Madeira