Lines 18-33
function StartUpload() {
Link Here
|
18 |
$("#uploadedfileid").val(''); |
18 |
$("#uploadedfileid").val(''); |
19 |
xhr= AjaxUpload( $('#fileToUpload'), $('#fileuploadprogress'), 'temp=1', cbUpload ); |
19 |
xhr= AjaxUpload( $('#fileToUpload'), $('#fileuploadprogress'), 'temp=1', cbUpload ); |
20 |
} |
20 |
} |
21 |
function cbUpload( status, fileid ) { |
21 |
function cbUpload( status, fileid, errors ) { |
22 |
if( status=='done' ) { |
22 |
if( status=='done' ) { |
23 |
$("#uploadedfileid").val( fileid ); |
23 |
$("#uploadedfileid").val( fileid ); |
24 |
$('#fileToUpload').prop('disabled',true); |
24 |
$('#fileToUpload').prop('disabled',true); |
25 |
$("#processfile").show(); |
25 |
$("#processfile").show(); |
26 |
} else { |
26 |
} else { |
|
|
27 |
var errMsgs = [ _("Error code 0 not used"), _("File already exists"), _("Directory is not writeable"), _("Root directory for uploads not defined"), _("Temporary directory for uploads not defined") ]; |
28 |
var errCode = errors[$('#fileToUpload').prop('files')[0].name].code; |
27 |
$("#fileuploadstatus").hide(); |
29 |
$("#fileuploadstatus").hide(); |
28 |
$("#fileuploadfailed").show(); |
30 |
$("#fileuploadfailed").show(); |
29 |
$("#fileuploadfailed").text( _("Upload status: ") + |
31 |
$("#fileuploadfailed").text( _("Upload status: ") + |
30 |
( status=='failed'? _("Failed"): |
32 |
( status=='failed'? _("Failed") + " - (" + errCode + ") " + errMsgs[errCode]: |
31 |
( status=='denied'? _("Denied"): status )) |
33 |
( status=='denied'? _("Denied"): status )) |
32 |
); |
34 |
); |
33 |
$("#processfile").hide(); |
35 |
$("#processfile").hide(); |