You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After uploading the same file again (I think) it overwrites the file. There is just one file under /public/upload folder and calling GET /upload shows multiple entries:
The text was updated successfully, but these errors were encountered:
safaorhan
changed the title
Uploading the same file with same name overwrites old file.
Uploading the same file with same name overwrites old file
Jul 3, 2016
3 years from now and having same problem, i just changed the md5 line that rename the files to this:
Date().now() // seems buggy
file.name = md5(new Date().getFullYear() + new Date().getSeconds() + file.name + new Date().getMonth() + new Date().getMinutes() ) + '.' + file.name.split('.').pop();
it worth it to take few minutes read plugin and write your own since this lib using formidable..
I uploaded a file name host.jpg for the first time. It saved the file into the folder /public/upload.
The response of calling
GET /upload
is fine:[{ "filename": "host.jpg", "filesize": 35706, "creationDate": 1467561753773, "uploaderId": "26c2828d6d9d08a5", "type": "image/jpeg", "id": "370fc11a74c8aa8b" }]
After uploading the same file again (I think) it overwrites the file. There is just one file under /public/upload folder and calling
GET /upload
shows multiple entries:[{ "filename": "host.jpg", "filesize": 35706, "creationDate": 1467561753773, "uploaderId": "26c2828d6d9d08a5", "type": "image/jpeg", "id": "370fc11a74c8aa8b" }, { "filename": "host.jpg", "filesize": 35706, "creationDate": 1467561950163, "uploaderId": "26c2828d6d9d08a5", "type": "image/jpeg", "id": "80e90364f3528877" }]
Is it the expected behavior?
The text was updated successfully, but these errors were encountered: