1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-19 13:19:44 +02:00

fix: Preserve extension for attachments with long filename

Closes #77
This commit is contained in:
Maksim Eltyshev 2024-09-16 00:45:53 +02:00
parent 73746b83d1
commit 7ee351fe30
4 changed files with 78 additions and 66 deletions

View file

@ -2,10 +2,11 @@ const fs = require('fs');
const path = require('path');
const rimraf = require('rimraf');
const moveFile = require('move-file');
const filenamify = require('filenamify');
const { v4: uuid } = require('uuid');
const sharp = require('sharp');
const filenamify = require('../../../utils/filenamify');
module.exports = {
inputs: {
file: {
@ -17,7 +18,6 @@ module.exports = {
async fn(inputs) {
const dirname = uuid();
// FIXME: https://github.com/sindresorhus/filenamify/issues/13
const filename = filenamify(inputs.file.filename);
const rootPath = path.join(sails.config.custom.attachmentsPath, dirname);