Skip to main content

Delete File

Description

A function from your project that is used to delete files. If your form contains images, it is possible with this function to delete only images from your server without deleting other data.

tip

Your function that will return "true" after successfully deleting file or "false" if not deleted successfully

Example:

src/admin/actions.ts
export async function deleteHeroFile(
params
): Promise<boolean> {
/* a query that will return true or false */
return true;
}

Params:

  • The parameters can be any data you use to delete file from server