fix(file-upload): size limitation was inverted

This commit is contained in:
Gregor Kleen 2020-07-23 17:58:15 +02:00
parent 908b1fc234
commit de53c80a1e

View File

@ -897,7 +897,7 @@ genericFileField mkOpts = Field{..}
handleUpload :: FileField -> Maybe Text -> ConduitT File FileReference (YesodDB UniWorX) ()
handleUpload FileField{fieldMaxFileSize} mIdent
= C.filter (\File{..} -> maybe (const True) (<) fieldMaxFileSize $ maybe 0 (fromIntegral . olength) fileContent)
= C.filter (\File{..} -> maybe (const True) (>) fieldMaxFileSize $ maybe 0 (fromIntegral . olength) fileContent)
.| sinkFiles
.| maybe (C.map id) mkSessionFile mIdent
where