Properly detect duplicate uploads
This commit is contained in:
parent
46352afc58
commit
1a21007068
2 changed files with 34 additions and 24 deletions
|
|
@ -105,7 +105,8 @@ function upload_file_with_ajax(file)
|
|||
error: function(xhr, txt, err)
|
||||
{
|
||||
console.log("AJAX file upload returned error: "+txt+" / "+err);
|
||||
display_error('Did you copy a proper image into your clipboard?');
|
||||
response = JSON.parse(xhr.responseText);
|
||||
display_error(response);
|
||||
},
|
||||
success: function(res)
|
||||
{
|
||||
|
|
@ -119,5 +120,5 @@ function upload_file_with_ajax(file)
|
|||
function display_error(msg)
|
||||
{
|
||||
$('#messages').html(
|
||||
'<div class="callout alert alert-callout-subtle radius">Sorry, pasting did not work.' + msg + '</div>')
|
||||
'<div class="callout alert alert-callout-subtle radius">Sorry, pasting did not work. ' + msg + '</div>')
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue