fix: get list of file under folder return all file in subfolder

This commit is contained in:
Methapon2001 2023-11-28 16:27:49 +07:00
parent 93f0ac3431
commit 046b915fc3
No known key found for this signature in database
GPG key ID: 849924FEF46BD132
6 changed files with 234 additions and 7 deletions

View file

@ -94,11 +94,13 @@ async function handleNotFoundRecord(
buffer: Buffer,
stat: { size: number; type: string },
) {
const path = pathname.split("/").slice(0, -1).join("/") + "/";
const filename = pathname.split("/").at(-1);
const base64 = Buffer.from(buffer).toString("base64");
const metadata = {
pathname,
path,
fileName: filename ?? "n/a", // should not possible to fallback, but just in case.
fileSize: stat.size,
fileType: stat.type,