php - BlueImp jQuery FIle Upload - Adding addition data to each file -


i have undertaken project create simple multiple file upload system can assign title each file uploaded. recommended go blueimp's jquery file uploader provides drag n drop ability.

so here getting confused. have looked @ tutorial or description given blueimp on github link here. can adding additional field applies files uploaded. (i using codeigniter handle files db).

so how go adding individual title each file added? cannot make sense of tut on github. (maybe jsfiddle example can go away learn from?)

edit*

now have managed input box added...rather simple add in end (doh!). have in index.html file

<script id="template-upload" type="text/x-tmpl"> {% (var i=0, file; file=o.files[i]; i++) { %}     <tr class="template-upload fade">         <td>             <span class="preview"></span>         </td>         <td>             <p class="name">{%=file.name%}</p>             {% if (file.error) { %}                 <div><span class="label label-important">error</span> {%=file.error%}</div>             {% } %}         </td>         <td class="title"><label>file title: <input name="title[]" required="required"></label></td>         <td>             <p class="size">{%=o.formatfilesize(file.size)%}</p>             {% if (!o.files.error) { %}                 <div class="progress progress-success progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><div class="bar" style="width:0%;"></div></div>             {% } %}         </td>         <td>             {% if (!o.files.error && !i && !o.options.autoupload) { %}                 <button class="btn btn-primary start">                     <i class="icon-upload icon-white"></i>                     <span>start</span>                 </button>             {% } %}             {% if (!i) { %}                 <button class="btn btn-warning cancel">                     <i class="icon-ban-circle icon-white"></i>                     <span>cancel</span>                 </button>             {% } %}         </td>     </tr> {% } %} </script> 

i have added bottom of main.js file

$('#fileupload').bind('fileuploadsubmit', function (e, data) {     var inputs = data.context.find(':input');     if (inputs.filter('[required][value=""]').first().focus().length) {         return false;     }     data.formdata = inputs.serializearray(); 

the next question have how assign title filename now?

just add file.name without extension value text field.

<td class="title"><label>file title: <input name="title[]" value="{%= file.name.split('/').pop().split('.').shift()%}"  required="required"></label></td>


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -