* 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
@@ -30,6 +30,7 @@
|
||||
"mime": "1.3.4",
|
||||
"mongodb": "2.2.10",
|
||||
"multer": "1.2.0",
|
||||
"node-uuid": "^1.4.7",
|
||||
"parse": "1.9.1",
|
||||
"parse-server-fs-adapter": "1.0.1",
|
||||
"parse-server-push-adapter": "1.1.0",
|
||||
|
||||
@@ -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