The js in the Image Upload demo provided by webuploader does not provide the callback information to verify whether the upload is successful, and many codes in that js are not verified. I can now upload the file successfully and save it to the database. when the upload fails, the upload page cannot be verified... the js in the Image Upload demo provided by webuploader does not provide callback information to verify whether the upload is successful.
And a lot of code in that js is not verified.
I can now upload successfully and save it to the database, but when the upload fails, the upload page cannot verify that the upload is successful.
I verified it like this.
uploader.on('uploadSuccess', function (file,response) { if(response.status==1){ $('#' + file.id).addClass('upload-state-done'); alert('response.url') } });
I am using the example in the image-upload folder in examples. There is a button to Click upload AND THE updateStatus under the folder to be thumbnail cannot be detected.
Is there a simple example to send
Reply content:
The js in the Image Upload demo provided by webuploader does not provide callback information to verify whether the upload is successful.
And a lot of code in that js is not verified.
I can now upload successfully and save it to the database, but when the upload fails, the upload page cannot verify that the upload is successful.
I verified it like this.
uploader.on('uploadSuccess', function (file,response) { if(response.status==1){ $('#' + file.id).addClass('upload-state-done'); alert('response.url') } });
I am using the example in the image-upload folder in examples. There is a button to Click upload AND THE updateStatus under the folder to be thumbnail cannot be detected.
Is there a simple example to send
You have not carefully read the document... Actually, there is a response parameter in addition to the file in the successful callback, which is used to receive the data returned by the server. You only need to return json and it will receive it. You can read the document carefully.
// The file is uploaded successfully. The class is added to the item and the style indicates that the upload is successful.
Uploader. on ('uploadsuccess', function (file, response) {var imgurl = response. url; // upload image path $ ('# images '). val (imgurl); $ ('#' + file. id ). addClass ('upload-state-success '). find (". state "). text ("uploaded") ;}); response. the url in the url returns my upload address. if it cannot determine whether the upload is successful, you will return a status in the background. if (status = 1) the upload is successful.