Barış Soner Uşaklı 10 years ago
parent c1ce0a9e1d
commit 767816e669

@ -119,8 +119,9 @@ function uploadFile(uid, uploadedFile, callback) {
return callback(new Error('[[error:file-too-big, ' + meta.config.maximumFileSize + ']]'));
}
var filename = uploadFile.name || 'upload';
filename = validator.escape(filename).substr(0, 255) + '-' + Date.now();
var filename = uploadedFile.name || 'upload';
filename = Date.now() + '-' + validator.escape(filename).substr(0, 255);
file.saveFileToLocal(filename, 'files', uploadedFile.path, function(err, upload) {
if (err) {
return callback(err);

Loading…
Cancel
Save