project-error / npwd

NPWD is a FiveM phone resource written entirely in TypeScript and React.
https://projecterror.dev
Other
338 stars 277 forks source link

Delete photo file after upload succeeds #1032

Closed BackSH00TER closed 11 months ago

BackSH00TER commented 12 months ago

Pull Request Description

Problem: If the user has the config useWebhook: true, picture files are created in the uploads/ folder but are never cleaned up / deleted after the upload succeeds, thus the files continue to build up on the machine.

Repro:

There is already a file cleanup called below for the codepath when useWebhook is false. The fix was to add the same file path cleanup inside the useWebhook flow.

Pull Request Checklist: