remove tmp file after saving to permanent directory

This commit is contained in:
grumbulon 2023-02-04 17:32:36 -05:00 committed by Gitea
parent 08eab3e6cb
commit a572f6841f

View file

@ -302,6 +302,10 @@ func (zone *ZoneRequest) Save() error {
if err = f.Close(); err != nil {
logHandler(genericResponseFields{"message": "Error closing file", "error": err.Error()})
}
if err = os.Remove(filepath.Clean(tmpPath)); err != nil {
logHandler(genericResponseFields{"message": "Error removing tmp file", "error": err.Error()})
}
}()
b, err := io.ReadAll(f)