My front-end uses Baidu's webUploader upload plug-in to upload images, and the back-end uses Thinkphp to receive file data. But if my back-end receives an error when receiving files, how do I return the data to notify the front-end to call the uploadError event callback method?
I read the official documentation, but there is no explanation. . . . I tried many data formats, but the front end still executes the uploadSuccess event method. . . I would like to ask for help. What data format should be returned if successful and what data format should be returned if failed?
为情所困2017-05-16 13:10:47
Here’s a method for your reference:
The server returns json. There is a status in the returned json to indicate whether the upload was successful. The front end should determine whether the server upload is successful in the uploadSuccess callback.
The uploadError event should be triggered when the server status code is wrong. For example, the server returns 500