mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 12:05:57 +01:00
removed some debug stuff from image upload
This commit is contained in:
@@ -19,13 +19,13 @@
|
||||
<div id="gravatar-box">
|
||||
<img id="user-gravatar-picture" src="" class="img-polaroid user-profile-picture">
|
||||
<span class="user-picture-label">Gravatar</span>
|
||||
<i class='icon-ok'></i>
|
||||
<i class='icon-ok icon-2x'></i>
|
||||
</div>
|
||||
|
||||
<div id="uploaded-box">
|
||||
<img id="user-uploaded-picture" src="" class="img-polaroid user-profile-picture">
|
||||
<span class="user-picture-label">Uploaded picture</span>
|
||||
<i class='icon-ok'></i>
|
||||
<i class='icon-ok icon-2x'></i>
|
||||
</div>
|
||||
|
||||
<a id="uploadPictureBtn" href="#">Upload new picture</a>
|
||||
|
||||
@@ -205,9 +205,9 @@ var express = require('express'),
|
||||
if(!req.user)
|
||||
return res.redirect('/403');
|
||||
|
||||
if(req.files.userPhoto.size > 65536) {
|
||||
if(req.files.userPhoto.size > 131072) {
|
||||
res.send({
|
||||
error: 'Images must be smaller than 64kb!'
|
||||
error: 'Images must be smaller than 128kb!'
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -244,15 +244,13 @@ var express = require('express'),
|
||||
filename = uid + '-' + filename
|
||||
var uploadPath = config.upload_path + filename;
|
||||
|
||||
console.log(uploadPath);
|
||||
|
||||
fs.rename(
|
||||
tempPath,
|
||||
global.configuration['ROOT_DIRECTORY'] + uploadPath,
|
||||
function(error) {
|
||||
if(error) {
|
||||
res.send({
|
||||
error: 'Error uploading file! Error : '+ JSON.stringify(error)
|
||||
error: 'Error uploading file!'
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -268,7 +266,6 @@ var express = require('express'),
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user