javascript - form submission to upload images - how to capture script errors -
I have an HTML form that has the following at a basic level: i upload images by calling it script image_upload.php Is designed for.
& lt; Form id = "browse-images" enctype = "multipart / form-data" action = "image / image_upload.php" method = "post" & gt; & Lt; Input id = "upload" name = "upload" class = "submit button btn btn-success upload-btn" style = "display: none; width: 6f float: right" type = "submit" value = " Upload "/> & Lt; / Form & gt;
I have error handling in the image_upload php script which checks whether the file type is acceptable, and throws an exception and returns the error as a JSON string.
I am at a loss how to capture the script when the script is called in this way?