|
|
|
@ -42,7 +42,7 @@ app.post('/api/upload', upload.single('image'), function(req, res) {// 单文件
|
|
|
|
|
const fileName = file.originalname;
|
|
|
|
|
const filePath = path.join(__dirname, 'uploads', fileName);
|
|
|
|
|
const user_name = req.query.user_name
|
|
|
|
|
// Check if file with same hash already exists in database
|
|
|
|
|
// 检查是否相同哈西值的数据存在
|
|
|
|
|
const sqlCheck = 'SELECT * FROM images WHERE hash = ?';
|
|
|
|
|
connection.query(sqlCheck, [fileHash], function(err, result) {
|
|
|
|
|
if (err) {
|
|
|
|
|