feat: allows local update api to replace existing files with newly uploaded ones

This commit is contained in:
James
2021-09-22 12:05:09 -04:00
parent 3c65f63fef
commit dbbff4cfa4
3 changed files with 11 additions and 1 deletions

View File

@@ -162,6 +162,11 @@ const result = await payload.update({
// a file directly through the Local API by providing
// its full, absolute file path.
filePath: path.resolve(__dirname, './path-to-image.jpg'),
// If you are uploading a file and would like to replace
// the existing file instead of generating a new filename,
// you can set the following property to `true`
overwriteExistingFiles: true,
})
```