javascript - Ask for advice: When using webuploader to upload images, what is the format of the server response data content?
过去多啦不再A梦
过去多啦不再A梦 2017-05-16 13:08:47
0
1
589

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?

过去多啦不再A梦
过去多啦不再A梦

reply all(1)
为情所困

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template