-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Access to response data in fileuploaded event #80
Comments
For ajax uploads you can send it using |
I may be misreading the docs then. As I understand it, the |
Yes you are right ... |
For my specific case I'm performing some server side processing of images and archives and I need to show the result to the user for confirmation. This requires the client to know the new urls of the processed images. Generally speaking I think there are more use cases where it is useful to be able to respond to data from the server after an upload. It is of course possible to store the data and get it in another AJAX call, it would just be convenient to not have to make additional requests. |
I understand - but all the more reason if you want to avoid further AJAX calls... you directly process everything you need in your server upload action as identified in You could display any calculated data based on this to the user in any separate div or alert box etc. Is there any reason why you want this information again after the file is uploaded (that's when your |
I am anyway noting an enhancement for ajax call to send back data to the client... but this may take a bit of time. Will keep the issue open. |
If, for instance, an upload contains an archive with a file structure of images. These images need to be sorted a certain way and the images are cropped to fit a certain aspect ratio. After the archive has been decompressed and the containing images have been processed, the user must be shown how the images look and how they are sorted after having been processed by the server. In this case, the response from the server would contain data about image sorting and urls to show the user. |
Resolved via upgrade to release v4.1.2. |
Wow that was fast! I'm still not sure this resolved the issue I meant to describe though. The response content from the server is a parameter in the AJAX This really is a great widget and you are responding to issues very quickly. So thank you! |
You should receive
|
Right. Awesome! |
There are some more updates to the plugin with release v4.1.3. You now get the output data from the upload events as a combined data object. This is applicable for the following events
For example: filebatchuploadsuccessThis event is triggered after a successful synchronous batch upload (i.e. when
$('#input-id').on('filebatchuploadsuccess', function(event, data) {
var formdata = data.form, files = data.files,
extradata = data.extra, responsedata = data.response;
console.log('File batch upload success');
}); |
|
On uploadUrl i want to print a string like.
i want to display that message when uploaded finished, i dont understand about event "fileUploaded" to get the message response. Help me please, thank. |
How can i access the data.response outside this function? $('#input-id').on('filebatchuploadsuccess', function(event, data) { pls Help, thanks |
@matosjoao please read about
|
Being able to send extra data from the server aside from errors would be useful.
The text was updated successfully, but these errors were encountered: