Diversified
Diversified
TTCTheo's Typesafe Cult
Created by Diversified on 1/4/2024 in #questions
How to set no of files that can be uploaded at a time using the provided Dropzone
No description
2 replies
TTCTheo's Typesafe Cult
Created by Diversified on 12/21/2023 in #questions
How to delete files in UploadThing?
I am using NextJS
"@uploadthing/react": "^6.0.2",
"next": "14.0.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"uploadthing": "^6.1.0"
"@uploadthing/react": "^6.0.2",
"next": "14.0.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"uploadthing": "^6.1.0"
I can't get the deleteFiles function to work for uploadthing What I have tried, created a uploadthing.js file in ~/server
"use server";

import { UTApi } from "uploadthing/server";

export const utapi = new UTApi();
"use server";

import { UTApi } from "uploadthing/server";

export const utapi = new UTApi();
I tried to call utapi.deleteFiles() but Webpack threw an error TypeError: _server_uploadthing__WEBPACK_IMPORTED_MODULE_3__.utapi.deleteFiles is not a function I also tried declaring and exporting deleteFiles explicitly in server actions and calling it but it threw error like Error deleting files: Error: inArray requires at least one value I have referred the official docs but couldn't infer how to delete files
11 replies