* increased filename length to 36 to make sure clients display correct filename * increased filename length to 36 to make sure clients display correct filename * added uuid prefix to saved filenames
This commit is contained in:
committed by
Florent Vilmart
parent
4c927dd898
commit
22c1a87d80
@@ -5,6 +5,7 @@ import AdaptableController from './AdaptableController';
|
||||
import { FilesAdapter } from '../Adapters/Files/FilesAdapter';
|
||||
import path from 'path';
|
||||
import mime from 'mime';
|
||||
import uuid from 'node-uuid';
|
||||
|
||||
const legacyFilesRegex = new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}-.*");
|
||||
|
||||
@@ -26,7 +27,7 @@ export class FilesController extends AdaptableController {
|
||||
contentType = mime.lookup(filename);
|
||||
}
|
||||
|
||||
filename = randomHexString(32) + '_' + filename;
|
||||
filename = uuid.v4() + '_' + filename;
|
||||
|
||||
var location = this.adapter.getFileLocation(config, filename);
|
||||
return this.adapter.createFile(filename, data, contentType).then(() => {
|
||||
|
||||
Reference in New Issue
Block a user