重命名

This commit is contained in:
赵鑫 2022-08-26 20:50:10 +08:00
parent acebcd95f4
commit 87261e3d5c
3 changed files with 3 additions and 4 deletions

4
package-lock.json generated
View File

@ -1,11 +1,11 @@
{ {
"name": "fileshare", "name": "filesharing",
"version": "0.1.0", "version": "0.1.0",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "fileshare", "name": "filesharing",
"version": "0.1.0", "version": "0.1.0",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {

View File

@ -1 +0,0 @@
// file_input.value = null

View File

@ -28,7 +28,7 @@ app.post('/upload', upload.single('file'), async (req, res) => {
const md5 = await md5file(file_temp_path) const md5 = await md5file(file_temp_path)
const file_save_path = path.join(__dirname, SAVE_PATH, md5) const file_save_path = path.join(__dirname, SAVE_PATH, md5)
if (!fs.existsSync(file_save_path)) { if (!fs.existsSync(file_save_path)) {
fs.cpSync(file_temp_path, file_save_path) // 复制文件到UPLOAD_PATH fs.cpSync(file_temp_path, file_save_path) // 复制临时文件到UPLOAD_PATH
} }
fs.unlinkSync(file_temp_path) // 删除临时文件 fs.unlinkSync(file_temp_path) // 删除临时文件
let file = { let file = {