Skip to content

Commit

Permalink
fix(tickets): error when uploading attachments #500
Browse files Browse the repository at this point in the history
  • Loading branch information
polonel committed May 12, 2022
1 parent ddf2486 commit d861f04
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/controllers/tickets.js
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ ticketsController.uploadImageMDE = function (req, res) {
ticketsController.uploadAttachment = function (req, res) {
const fs = require('fs-extra')
const Busboy = require('busboy')
const busboy = new Busboy({
const busboy = Busboy({
headers: req.headers,
limits: {
files: 1,
Expand All @@ -659,8 +659,9 @@ ticketsController.uploadAttachment = function (req, res) {
if (fieldname === 'ownerId') object.ownerId = val
})

busboy.on('file', function (fieldname, file, filename, encoding, mimetype) {
// winston.debug(mimetype);
busboy.on('file', function (name, file, info) {
const filename = info.filename
const mimetype = info.mimeType

if (
mimetype.indexOf('image/') === -1 &&
Expand Down

0 comments on commit d861f04

Please sign in to comment.