diff --git a/main.go b/main.go index 7a408f9..5fe6313 100644 --- a/main.go +++ b/main.go @@ -67,6 +67,10 @@ func Upload(c echo.Context) error { return err } + if _, err := os.Stat("files/" + file.Filename); err == nil { + return c.String(http.StatusOK, "A file with the same name already exist's on the server.\n") + } + src, err := file.Open() if err != nil { return err