重命名
This commit is contained in:
parent
acebcd95f4
commit
87261e3d5c
4
package-lock.json
generated
4
package-lock.json
generated
@ -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": {
|
||||||
|
@ -1 +0,0 @@
|
|||||||
// file_input.value = null
|
|
@ -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 = {
|
||||||
|
Loading…
Reference in New Issue
Block a user