mirror of
https://github.com/sigoden/dufs.git
synced 2026-04-08 16:49:02 +03:00
[GH-ISSUE #427] Clicking "Save file" on editor page breaks images #232
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @skr2005 on GitHub (Aug 5, 2024).
Original GitHub issue: https://github.com/sigoden/dufs/issues/427
Problem
After enabling upload and delete, there will be "edit" button after file names. "Edit" an image. The image will show in the page. Then click "Save file", and the image will be damaged (become empty file).
I think this behavior will be a surprise for users not familiar with it, and what's more, it can lead to data loss, so I suggest only enable "Edit" and "Save" for files recognized to have text types.
Configuration
--allow-upload & --allow-delete.
Log
2024-08-05T15:18:52+08:00 INFO - ::1 "GET /" 200
2024-08-05T15:18:56+08:00 INFO - ::1 "GET /test.png" 200
2024-08-05T15:19:06+08:00 INFO - ::1 "GET /test.png?edit" 200
2024-08-05T15:19:07+08:00 INFO - ::1 "GET /test.png" 200
2024-08-05T15:19:21+08:00 INFO - ::1 "PUT /test.png" 201
2024-08-05T15:19:21+08:00 INFO - ::1 "GET /test.png?edit" 200
2024-08-05T15:19:21+08:00 INFO - ::1 "GET /test.png" 200
Environment: