fix upload error

This commit is contained in:
chiu 2020-01-07 20:28:39 +08:00
parent 8c8e44809d
commit b6a473042e
2 changed files with 37 additions and 26 deletions

View File

@ -1,18 +1,29 @@
function init_upload(temp_length){
var value = $("input[name='all_upload_length']")
if (value.val()==''){
value.val(temp_length)
$.ajax({
type : "post",
url : "/admin/galleries/init_upload",
dataType : "json",
data:{all_length: value.val()},
async: false,
global:false,
success: function()
{
},
error : function(data){
alert('init upload process failed, please try again later.')
}
});
if (value.val()=='1'){
value.val('')
}
}
}
function form_submit() {
var temp_length = $('#file-list').find('li.template-upload').length
$.ajax({
type : "post",
url : "/admin/galleries/init_upload",
dataType : "json",
data:{all_length: temp_length},
async: false,
success: function()
{
},
error : function(data){
alert('init upload process failed, please try again later.')
}
});
init_upload(temp_length)
var length_upload
var count_upload
var send_start
@ -38,25 +49,24 @@ function form_submit() {
window.location.href = '/admin/galleries/upload_process'
}
})
$.ajax({
url : "/admin/galleries/start_upload_process",
dataType : "json",
type : "post",
error: function(){
alert('init upload process failed, please try again later.')
},
success: function(){
window.location.href = '/admin/galleries/upload_process'
}
})
}
});
}
}
function form_only_one_submit() {
var temp_length = 1
$.ajax({
type : "post",
url : "/admin/galleries/init_upload",
dataType : "json",
data:{all_length: temp_length},
async: false,
success: function()
{
},
error : function(data){
alert('init upload process failed, please try again later.')
}
});
init_upload(temp_length)
}
!function ($) {
$.fn.checkListLength = function (param){

View File

@ -8,6 +8,7 @@
</ul>
</div> -->
<!-- Bottom Nav -->
<input name='all_upload_length' type="hidden">
<div class="order-edit-notification">Images re-ordering enabled.</div>
<div class="bottomnav clearfix">
<div class="action pull-left">