diff options
author | FChannel <> | 2021-07-25 13:49:05 -0700 |
---|---|---|
committer | FChannel <> | 2021-07-25 13:49:05 -0700 |
commit | 74b29610d09b05b3f563bb84e8ec65b534c2ee83 (patch) | |
tree | 7beb143edce67816fc6b3d7663df8e3960c750fb /main.go | |
parent | def81637bc3d9f7ff73fed2786dbaa7a78086799 (diff) |
added modification to media ban
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -804,9 +804,14 @@ func main() { f, err := os.Open("." + file) CheckError(err, "could not open attachment for ban media") - defer f.Close() - bytes, err := ioutil.ReadAll(f) - CheckError(err, "could not get attachment bytes for ban media") + defer f.Close() + + bytes := make([]byte, 2048) + + _, err = f.Read(bytes) + if err != nil { + fmt.Println("error readin bytes for setting media ban") + } if !IsMediaBanned(db, f) { query := `insert into bannedmedia (hash) values ($1)` @@ -1974,7 +1979,7 @@ func MakeCaptchas(db *sql.DB, total int) { } func GetFileContentType(out multipart.File) (string, error) { - + buffer := make([]byte, 512) _, err := out.Read(buffer) |