From 687ef6b297e551167cd5f48b4b0e1f12e5c05f77 Mon Sep 17 00:00:00 2001 From: Songlx516 Date: Sat, 5 Sep 2026 20:04:11 +0800 Subject: [PATCH] feat(upload): "Upload and extract" now accepts .rar (v1.8.3 hotfix) Server-side dispatch in src/extract.c:79 already routes .rar to rar_extract(), but the upload + extract entry point was hard-coded to accept only .zip via two layers: - assets/index.html:71 - assets/main.js:2340 if (!/\.zip$/i.test(file.name)) return; v1.8.3 relaxes both to also accept .rar (and the two RAR MIME types), plus a small i18n pass so the "uploading ZIP"/"ZIP body is large" copy reads sensibly when the user picks a RAR. No backend, no engine, no vendored changes. What this enables today (v1.8.3): - Upload a single-volume plaintext .rar in one click and have the existing rar_extract() engine process it. Uploaded archive is auto-deleted on success, same as .zip since v1.7. Still NOT enabled (planned for v1.9.0): - Multi-volume RAR (name.part01.rar + name.part02.rar + ...) - Encrypted RAR (password-protected headers / entries) Both still return extract_unsupported from the existing third_party/unrar/dmc_unrar 1.7.0 (GPL-2.0) engine. v1.9.0 will swap the vendor to opello/unrar 7.20.1 (UnRAR License) which natively handles both. Files (4): assets/index.html: accept=".zip,.rar,application/zip, application/x-zip-compressed, application/vnd.rar, application/x-rar-compressed" assets/main.js: upload pre-check regex /.(zip|rar)$/i assets/lang-en.js: "ZIP will be deleted" -> "archive will be deleted" assets/lang-zh.js: upload ZIP / volume ZIP wording neutralized CHANGELOG.md: v1.8.3 entry added above v1.8.2 84 host-side checks (70 ZIP + 14 RAR), 0 failures. --- CHANGELOG.md | 52 +++++++++++++++++++++++++++++++++++++++++++++++ assets/index.html | 2 +- assets/lang-en.js | 2 +- assets/lang-zh.js | 4 ++-- assets/main.js | 2 +- 5 files changed, 57 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1679cba..6a1fdbc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ All notable changes to **PS5 Web File Manager** are documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +> Release artifact for v1.8.3: +> `web-file-mgr.elf` — size TBD +> sha256 TBD +> ELF class 64, little-endian, e_machine `0x003e` (x86_64-sie-ps5) +> +> Source delta vs v1.8.2: 4 files touched (2 frontend, 2 i18n); no backend, +> no engine, no vendored changes. +> > Release artifact for v1.8.2: > `web-file-mgr.elf` — size 509 704 bytes (~497 KiB) > sha256 `1b2c3d68b35e32737105f17d14a80a3c159ceca0cabd274ee168cbcd81906f65` @@ -16,6 +24,50 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 > (`Makefile` CFLAGS `-Ithird_party/unrar`, `src/extract.c` forward > declaration of `extract_progress`); no vendored or engine changes. +## [v1.8.3] — 2026-09-05 + +**Hotfix: "Upload and extract" now accepts `.rar` files.** + +The "upload and extract" entry was hard-coded to accept only `.zip`, +even though the server-side dispatch in `src/extract.c:79` already +correctly routes `.rar` to `rar_extract()`. v1.8.3 fixes the frontend +filter so users can select a single-volume plaintext `.rar` from the +file picker and have it uploaded + extracted in one click (the same +flow that already worked for `.zip`). + +What this enables: + +- Choose a single-volume `.rar` from "Upload and extract" +- Server extracts it via the existing `rar_extract()` engine +- Uploaded `.rar` is auto-deleted after a successful extract (same as + `.zip` since v1.7) + +What this does **not** enable (planned for v1.9.0): + +- **Multi-volume RAR** (e.g. `name.part01.rar` + `name.part02.rar` …) +- **Encrypted RAR** (password-protected headers or entries) + +Both still return `extract_unsupported` "single-volume RAR only" / +"encrypted RAR is not supported; please extract on a PC first" — see +the underlying engine limit in `third_party/unrar/dmc_unrar` (GPL-2.0, +1.7.0). v1.9 will swap the vendor to **opello/unrar 7.20.1** (UnRAR +License) which natively supports both. + +Changed: + +- `assets/index.html` — `` now lists + `.rar` + the two RAR MIME types next to the existing ZIP entries. +- `assets/main.js:2340` — `/\.zip$/i` → `/\.(zip|rar)$/i` (the upload + pre-check), plus a local `isRar` flag so the next step branches. +- `assets/lang-en.js` — `extractUploadConfirm`: "uploaded ZIP" → + "uploaded archive". +- `assets/lang-zh.js` — `extractUploadConfirm` & `extractLargeAsk` + drop the "ZIP" wording so the copy reads sensibly for RAR uploads. + +No backend changes — the server side was already correct. No test +changes — the existing RAR happy-path test in `tests/test_rar_extract.c` +passes against the same backend. + ## [v1.8.2] — 2026-09-05 **Hotfix: default ZIP extraction limits cover 3A-game single-file archives.** diff --git a/assets/index.html b/assets/index.html index 029e89c..3f1cece 100644 --- a/assets/index.html +++ b/assets/index.html @@ -68,7 +68,7 @@ - +
diff --git a/assets/lang-en.js b/assets/lang-en.js index 1ae7776..a6b057f 100644 --- a/assets/lang-en.js +++ b/assets/lang-en.js @@ -101,7 +101,7 @@ window.WFM_LANG = { extracting: "Extracting", extractConfirm: "Extract {name} to {path}?", extractOverwriteAsk: "If a file or folder with the same name already exists in the target:\n\nOK = overwrite same-name files (folders still merge)\nCancel = fail if the target already exists", - extractUploadConfirm: "Upload and extract {name}?\n\nTarget folder: {path}\nThe uploaded ZIP will be deleted after success.", + extractUploadConfirm: "Upload and extract {name}?\n\nTarget folder: {path}\nThe uploaded archive will be deleted after success.", extractStarted: "Extraction started: {name}", extractDone: "Extraction complete: {name}", extractProgress: "{done} / {total} files", diff --git a/assets/lang-zh.js b/assets/lang-zh.js index f98f0da..1e17494 100644 --- a/assets/lang-zh.js +++ b/assets/lang-zh.js @@ -101,11 +101,11 @@ window.WFM_LANG = { extracting: "解压", extractConfirm: "解压 {name} 到 {path}?", extractOverwriteAsk: "若目标已存在同名文件或目录:\n\n确定 = 覆盖同名文件(目录仍会合并)\n取消 = 若目标已存在则失败", - extractUploadConfirm: "上传并解压 {name}?\n\n目标目录:{path}\n成功后将删除上传的 ZIP。", + extractUploadConfirm: "上传并解压 {name}?\n\n目标目录:{path}\n成功后将删除上传的压缩包。", extractStarted: "已开始解压 {name}", extractDone: "解压完成:{name}", extractProgress: "{done} / {total} 个文件", - extractLargeAsk: "ZIP 体积较大({size}),是否启用「大文件模式」?\n\n确定 = 启用(单文件最大 1 TiB / 总解压最大 4 TiB)\n取消 = 默认限制(单文件 512 GiB / 总解压 2 TiB),可能拒绝此压缩包", + extractLargeAsk: "压缩包体积较大({size}),是否启用「大文件模式」?\n\n确定 = 启用(单文件最大 1 TiB / 总解压最大 4 TiB)\n取消 = 默认限制(单文件 512 GiB / 总解压 2 TiB),可能拒绝此压缩包", extractLargeActive: "此任务已启用大文件模式", extractSelectMainVolume: "请改选主卷(如 .rar 或 .part01.rar)", extractArchivePending: "正在准备解压 {name}", diff --git a/assets/main.js b/assets/main.js index 37b60d7..4b0d58c 100644 --- a/assets/main.js +++ b/assets/main.js @@ -2337,7 +2337,7 @@ function actionUploadAndExtract() { async function uploadAndExtractFile(file) { if (busy || loadingPath) return; - if (!/\.zip$/i.test(file.name || "")) { + if (!/\.(zip|rar)$/i.test(file.name || "")) { alert(t("err_extract_unsupported", { arg: file.name })); return; }