mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-05 21:45:47 +01:00
removed old upload code
This commit is contained in:
@@ -139,8 +139,6 @@ var user = require('./../user.js'),
|
|||||||
var is = fs.createReadStream(tempPath);
|
var is = fs.createReadStream(tempPath);
|
||||||
var os = fs.createWriteStream(global.configuration['ROOT_DIRECTORY'] + uploadPath);
|
var os = fs.createWriteStream(global.configuration['ROOT_DIRECTORY'] + uploadPath);
|
||||||
|
|
||||||
is.pipe(os);
|
|
||||||
|
|
||||||
is.on('end', function(){
|
is.on('end', function(){
|
||||||
fs.unlinkSync(tempPath);
|
fs.unlinkSync(tempPath);
|
||||||
|
|
||||||
@@ -159,36 +157,7 @@ var user = require('./../user.js'),
|
|||||||
console.log(err);
|
console.log(err);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
is.pipe(os);
|
||||||
|
|
||||||
/*util.pump(is, os, function() {
|
|
||||||
fs.unlinkSync('source_file');
|
|
||||||
});*/
|
|
||||||
|
|
||||||
|
|
||||||
/*fs.rename(
|
|
||||||
tempPath,
|
|
||||||
global.configuration['ROOT_DIRECTORY'] + uploadPath,
|
|
||||||
function(error) {
|
|
||||||
if(error) {
|
|
||||||
console.log(error);
|
|
||||||
res.send({
|
|
||||||
error: 'Error uploading file!'
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var imageUrl = config.upload_url + filename;
|
|
||||||
|
|
||||||
res.send({
|
|
||||||
path: imageUrl
|
|
||||||
});
|
|
||||||
|
|
||||||
user.setUserField(uid, 'uploadedpicture', imageUrl);
|
|
||||||
user.setUserField(uid, 'picture', imageUrl);
|
|
||||||
|
|
||||||
}
|
|
||||||
);*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user