Mercurial > gemma
diff pkg/controllers/srimports.go @ 4875:6237e6165041
* Raise the upload limit for sounding results from 25GB up to 50GB.
* Issue an error if sounding results uploads are over the limit instead of
silently truncating them.
* Fix a file handle leak when storing all uploads.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Fri, 31 Jan 2020 23:17:37 +0100 |
parents | 4394daeea96a |
children | 85f19e924a43 |
line wrap: on
line diff
--- a/pkg/controllers/srimports.go Fri Jan 31 17:11:30 2020 +0100 +++ b/pkg/controllers/srimports.go Fri Jan 31 23:17:37 2020 +0100 @@ -40,7 +40,7 @@ const ( soundingResultName = "soundingresult" - maxSoundingResultSize = 25 * 1024 * 1024 + maxSoundingResultSize = 50 * 1024 * 1024 ) func fetchSoundingResult(req *http.Request) (string, error) { @@ -63,11 +63,12 @@ return dst, nil } - return misc.StoreUploadedFile( + return misc.StoreUploadedFileCheck( req, soundingResultName, "sr.zip", maxSoundingResultSize, + true, ) } @@ -194,11 +195,12 @@ func uploadSoundingResult(req *http.Request) (jr mw.JSONResult, err error) { var dir string - if dir, err = misc.StoreUploadedFile( + if dir, err = misc.StoreUploadedFileCheck( req, soundingResultName, "sr.zip", maxSoundingResultSize, + true, ); err != nil { return }