sn-client icon indicating copy to clipboard operation
sn-client copied to clipboard

[BUG] Can't overwrite an existing file with a new, empty file

Open hashtagnulla opened this issue 2 years ago • 1 comments

🐜 Describe the bug

If I upload a file in order to overwrite an existing file (with the same filename) on the server, the backend sends me a HTTP 204 response, but actually it does not modify the old file.

👉 Steps To Reproduce

  1. Upload a file
  2. Upload an empty file with the same name of the first one. You must enable "overwrite" flag.
  3. You should see that the response is OK, but no change has occurred on the server

hashtagnulla avatar Jul 28 '22 06:07 hashtagnulla

The server side seems to be fixed, but now the client throws the following error when trying to upload an empty txt (0 bytes) file on top of an existing file with the same name:

SyntaxError: Unexpected end of JSON input
    at Upload.uploadNonChunked (https://admin.test.sensenet.com/static/js/main.381ee0ec.js:1:381639)
    at async Trace.callMethodAsync (https://admin.test.sensenet.com/static/js/main.381ee0ec.js:1:404499)
    at async Upload.file (https://admin.test.sensenet.com/static/js/main.381ee0ec.js:1:380574)

Repository: https://insql-daily.test.sensenet.cloud

tusmester avatar Aug 20 '22 07:08 tusmester