I would like to use the jQuery interface but how is it possible to get the server's response on 'filedone'? I would like the server to rename the uploaded file to avoid collisions and pass the new name back to the web page.
Simply use XHR object given to 'done' event as in $().on('filedone', function (e, file, xhr)) - e.g. its responseText field to get whatever was output by the server. Note that it won't work for iframe (if you're using it) - see the docs for iframeDone and the comment about filedone in the source code around the end of the file.
Simply use XHR object given to 'done' event as in
$().on('filedone', function (e, file, xhr))
- e.g. itsresponseText
field to get whatever was output by the server. Note that it won't work for iframe (if you're using it) - see the docs for iframeDone and the comment about filedone in the source code around the end of the file.