I’ve got issue with jQuery File Upload (blueimp).
On uploading files I insert file data to DB. Right after that I can get last insert id. The issue: How can i transmit this value from PHP to JavaScript Template?
To be more clear, I need template like:
<script id="template-download" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<div class="template-download fade" id="file-{%=file.id%}">
<div class="name"><span>{%=file.name%}</span></div>
....
</div>
{% } %}
</script>
where file.id is my last insert id that was defined in PHP.
SOLUTUON: Function post in class UploadHandler. Add something like
$info[$index]->myvar= 'something';
then we can use file.myvar in template.
I had some extra form data, and I had luck with adding them to the function
handle_file_upload