Reverted the previous commit
This commit is contained in:
@@ -3,7 +3,7 @@ import type {NextApiRequest, NextApiResponse} from "next";
|
||||
import {withIronSessionApiRoute} from "iron-session/next";
|
||||
import {sessionOptions} from "@/lib/session";
|
||||
import axios from "axios";
|
||||
import formidable from "formidable";
|
||||
import formidable from "formidable-serverless";
|
||||
import {getStorage, ref, uploadBytes} from "firebase/storage";
|
||||
import fs from "fs";
|
||||
import {app} from "@/firebase";
|
||||
@@ -18,7 +18,7 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||
|
||||
const storage = getStorage(app);
|
||||
|
||||
const form = formidable({keepExtensions: true});
|
||||
const form = formidable({keepExtensions: true, uploadDir: "./"});
|
||||
await form.parse(req, async (err: any, fields: any, files: any) => {
|
||||
const audioFile = files.audio;
|
||||
const audioFileRef = ref(storage, `speaking_recordings/${(audioFile as any).path.replace("upload_", "")}`);
|
||||
|
||||
Reference in New Issue
Block a user