mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 07:56:16 -04:00
Support to allow for a setting so you can stop unknown file types from being imported
This commit is contained in:
parent
9d1eca42b3
commit
17f26b8c2c
3 changed files with 20 additions and 7 deletions
|
@ -92,9 +92,14 @@ exports.doImport = function(req, res, padId)
|
|||
}
|
||||
//we need to rename this file with a .txt ending
|
||||
else {
|
||||
var oldSrcFile = srcFile;
|
||||
srcFile = path.join(path.dirname(srcFile),path.basename(srcFile, fileEnding)+".txt");
|
||||
fs.rename(oldSrcFile, srcFile, callback);
|
||||
if(settings.allowUnknownFileEnds === true){
|
||||
var oldSrcFile = srcFile;
|
||||
srcFile = path.join(path.dirname(srcFile),path.basename(srcFile, fileEnding)+".txt");
|
||||
fs.rename(oldSrcFile, srcFile, callback);
|
||||
}else{
|
||||
console.warn("Not allowing unknown file type to be imported", fileEnding);
|
||||
callback("uploadFailed");
|
||||
}
|
||||
}
|
||||
},
|
||||
function(callback){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue