My Kanaban card file attachment uploads are actually working - files arrive on the server as expected - so I’m very close. But, I need a little help with two remaining problems:
-
How can I send the card ID along with the file being upload, so the file can be connected to the proper card? As it is now, the server simply receives a random file with no other information about what it belongs to.
-
After the file is uploaded, in the browser I just see a broken image. The script on the server renames the file and moves it to a proper location. So, I must have to return the image page/name, but I don’t see how to do that.
My server script returns this on success:
{ “status”: “server” }
Should I include something else in the response to specify the new file name and path? Can I also include a unique ID # for the new uploaded file?
I’m including my configuration below in case I’m doing it wrong in the first place.
webix.ui({
multi: true,
container:'kbox',
view: 'kanban',
cols:[
{ header:'<span class="webix_icon webix_kanban_add_icon webix_kanban_icon kbi-plus-circle webixbutton add" style="margin-left: 0; padding-left: 0; "></span>To Do',
body:{ view:'kanbanlist', status:'0' },
onClick:{
'add':function(){
this.getParentView().add({ status:'0', text:'New task' });
return false;
}
}
},
{ header:'In Progress',
body:{ view:'kanbanlist', status:'1' }},
{ header:'Review',
body:{ view:'kanbanlist', status:'2' }},
{ header:'Done',
body:{ view:'kanbanlist', status:'3' }}
],
save: {
'insert': 'json->kanban_saveCard.php?bid=21',
'update': 'json->kanban_updateCard.php?bid=21',
'delete': 'json->kanban_deleteCard.php?bid=21'
},
userList: true,
attachments: 'kanban_upload.php?bid=21',
comments: {currentUser: 30001},
data: base_task_set,
editor: true,
cardActions: true,
colors: colors_set,
tags: tags_set,
users: users_set
});