$('#fileupload').fileupload({ url: 'server/php/' }).on('fileuploadsubmit', function (e, data) { data.formData = data.context.find(':input').serializeArray(); });
in js/main.js (old code commented)
$(function () {
'use strict';
// Initialize the jQuery File Upload widget:
$('#fileupload').fileupload({
url: 'server/php/'
}).on('fileuploadsubmit', function (e, data) {
data.formData = data.context.find(':input').serializeArray();
});
// old code below
/*$('#fileupload').fileupload({
// Uncomment the following to send cross-domain cookies:
//xhrFields: {withCredentials: true},
url: 'server/php/'
});
*/
and..
<label class="title"> <span>Title:</span><br> <input name="title[]" class="form-control"> </label> <label class="description"> <span>Description:</span><br> <input name="description[]" class="form-control"> </label>
in (the file you are using to upload, maybe index.html at the root of uploader dir
Example:
<!-- The template to display files available for upload -->
<script id="template-upload" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<tr class="template-upload fade">
<td>
<span class="preview"></span><br>
<label class="title">
<span>Title:</span><br>
<input name="title[]" class="form-control">
</label>
<label class="description">
<span>Description:</span><br>
<input name="description[]" class="form-control">
</label>
</td>
<p class="title"><strong>Имя <br /><input name="title[]" value="{%=file.title||''%}"></strong></p><p class="description">Описание<br /> <input name="description[]" value="{%=file.description||''%}"></p>
public function update($print_response = true) {
jQuery-File-Upload › PHP integration! Then I found this thread and it is all working perfectly! Thanks so much! Eddie | |