upd: nama file saat upload di semua fitur mobile

This commit is contained in:
2025-08-29 14:36:48 +08:00
parent d7a90db6a7
commit e345e97023
4 changed files with 5 additions and 5 deletions

View File

@@ -60,9 +60,9 @@ export async function POST(request: Request) {
for (var pair of body.entries()) {
if (String(pair[0]).substring(0, 4) == "file") {
const file = body.get(pair[0]) as File
const fileName = file.name
const fileName = decodeURIComponent(file.name)
const fExt = file.name.split(".").pop()
let fName = file.name.replace("." + fExt, "")
let fName = fileName.replace("." + fExt, "")
const cek = dataOmit.some((i: any) => i.file == fileName)
if (cek) {
const random = Math.floor(Math.random() * 1000)

View File

@@ -77,7 +77,7 @@ export async function PUT(request: Request, context: { params: { id: string } })
}
const file = body.get("file") as File
const fileName = file.name
const fileName = decodeURIComponent(file.name)
const dataCek = await prisma.project.count({
where: {

View File

@@ -227,7 +227,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.project })
if (upload.success) {
await prisma.projectFile.create({

View File

@@ -173,7 +173,7 @@ export async function PUT(request: Request, context: { params: { id: string } })
}
const file = body.get("file") as File
const fileName = file.name
const fileName = decodeURIComponent(file.name)
const dataCek = await prisma.divisionProject.count({
where: {