mirror of
https://github.com/prasathmani/tinyfilemanager
synced 2026-03-14 20:55:50 +01:00
Add JSON Parse Error Handling in Upload Script (#1196)
* Add JSON Parse Error Handling in Upload Script * Update tinyfilemanager.php * Update tinyfilemanager.php
This commit is contained in:
parent
843e240757
commit
a4d96e0eaf
1 changed files with 7 additions and 3 deletions
|
|
@ -1398,10 +1398,14 @@ if (isset($_GET['upload']) && !FM_READONLY) {
|
|||
toast('Error: Server Timeout');
|
||||
});
|
||||
}).on("success", function (res) {
|
||||
let _response = JSON.parse(res.xhr.response);
|
||||
try {
|
||||
let _response = JSON.parse(res.xhr.response);
|
||||
|
||||
if(_response.status == "error") {
|
||||
toast(_response.info);
|
||||
if(_response.status == "error") {
|
||||
toast(_response.info);
|
||||
}
|
||||
} catch (e) {
|
||||
toast("Error: Invalid JSON response");
|
||||
}
|
||||
}).on("error", function(file, response) {
|
||||
toast(response);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue