mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
Working on API side.
This commit is contained in:
@@ -7,19 +7,16 @@ export async function GET(
|
||||
{params}: { params: Promise<{ fileName: string }> }
|
||||
) {
|
||||
|
||||
// Retrieve params
|
||||
const {searchParams} = new URL(request.url);
|
||||
const token = searchParams.get('token');
|
||||
const expires = searchParams.get('expires');
|
||||
const fileName = (await params).fileName
|
||||
|
||||
|
||||
const privateLocalDir = "private/uploads/";
|
||||
const filePath = path.join(privateLocalDir, fileName);
|
||||
|
||||
const crypto = require('crypto');
|
||||
|
||||
|
||||
if (!fs.existsSync(filePath)) {
|
||||
return NextResponse.json(
|
||||
{error: 'File not found'},
|
||||
|
||||
Reference in New Issue
Block a user