uvdesk / community-skeleton

UVdesk Opensource Community Helpdesk Project built for all to make a Full Ticketing Support System along with many more other features.
https://www.uvdesk.com
MIT License
7.18k stars 448 forks source link

Attaching a file from code #637

Closed Evgl1 closed 1 year ago

Evgl1 commented 1 year ago

Hello. Can you please tell me how can I add a manually created file in the code to the form? I created it here /var/www/html/helpdesk-vc/vendor/uvdesk/core-framework/Resources/views/Templates/attachment.html.twig. I need to attach another file from the code, how can I do it?

Evgl1 commented 1 year ago

dt = new DataTransfer() for (i = 0, l = currentElement[0].files.length; i < l; i++) { dt.items.add(currentElement[0].files[i]) } dt.items.add(workbook_cards_out_file) currentElement[0].files = dt.files attachmentBlock.append(this.labelTemplate({'fileName': fileName.replace('.xls', '') + ' (t1...).xls'}))