[GH-ISSUE #427] Clicking "Save file" on editor page breaks images #232

Closed
opened 2026-04-08 16:51:21 +03:00 by zhus · 0 comments
Owner

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:

  • Dufs version: 0.41.0
  • Browser info: Edge
  • OS info: Windows 11
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:** - Dufs version: 0.41.0 - Browser info: Edge - OS info: Windows 11
zhus closed this issue 2026-04-08 16:51:21 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sigoden/dufs#232