fix: decode URI component pada nama file upload di endpoint mobile
This commit is contained in:
@@ -164,7 +164,7 @@ export async function POST(request: Request, context: { params: { id: string } }
|
||||
if (String(pair[0]).substring(0, 4) == "file") {
|
||||
const file = body.get(pair[0]) as File
|
||||
const fExt = file.name.split(".").pop()
|
||||
const fName = file.name.replace("." + fExt, "")
|
||||
const fName = decodeURIComponent(file.name.replace("." + fExt, ""))
|
||||
|
||||
const upload = await funUploadFile({ file: file, dirId: DIR.project })
|
||||
if (upload.success) {
|
||||
|
||||
@@ -84,7 +84,7 @@ export async function POST(request: Request, context: { params: { id: string } }
|
||||
|
||||
const file = body.get(key) as File;
|
||||
const fExt = file.name.split(".").pop();
|
||||
const fName = file.name.replace("." + fExt, "");
|
||||
const fName = decodeURIComponent(file.name.replace("." + fExt, ""));
|
||||
|
||||
const upload = await funUploadFile({ file, dirId: DIR.project });
|
||||
if (!upload.success) continue;
|
||||
|
||||
@@ -114,7 +114,7 @@ export async function POST(request: Request, context: { params: { id: string } }
|
||||
if (String(pair[0]).substring(0, 4) == "file") {
|
||||
const file = body.get(pair[0]) as File
|
||||
const fExt = file.name.split(".").pop()
|
||||
const fName = file.name.replace("." + fExt, "")
|
||||
const fName = decodeURIComponent(file.name.replace("." + fExt, ""))
|
||||
|
||||
|
||||
const upload = await funUploadFile({ file: file, dirId: DIR.task })
|
||||
|
||||
@@ -213,7 +213,7 @@ export async function POST(request: Request) {
|
||||
if (String(pair[0]).substring(0, 4) == "file") {
|
||||
const file = body.get(pair[0]) as File
|
||||
const fExt = file.name.split(".").pop()
|
||||
const fName = file.name.replace("." + fExt, "")
|
||||
const fName = decodeURIComponent(file.name.replace("." + fExt, ""))
|
||||
|
||||
const upload = await funUploadFile({ file: file, dirId: DIR.task })
|
||||
if (upload.success) {
|
||||
|
||||
@@ -87,7 +87,7 @@ export async function POST(request: Request, context: { params: { id: string } }
|
||||
|
||||
const file = body.get(key) as File;
|
||||
const fExt = file.name.split(".").pop();
|
||||
const fName = file.name.replace("." + fExt, "");
|
||||
const fName = decodeURIComponent(file.name.replace("." + fExt, ""));
|
||||
|
||||
const upload = await funUploadFile({ file, dirId: DIR.task });
|
||||
if (!upload.success) continue;
|
||||
|
||||
Reference in New Issue
Block a user