# HG changeset patch # User Tom Gottfried # Date 1565016491 -7200 # Node ID 00279b36cffdf91c43d95f80d3510ae488e89ef9 # Parent d3fb2f37380b24b5aa0fe7b68c6cd84109b10886# Parent 9cbed444b8a423c3e7419a4b5eab8b3ea2adc423 Merged diff -r d3fb2f37380b -r 00279b36cffd pkg/misc/http.go --- a/pkg/misc/http.go Mon Aug 05 16:45:48 2019 +0200 +++ b/pkg/misc/http.go Mon Aug 05 16:48:11 2019 +0200 @@ -24,6 +24,12 @@ "gemma.intevation.de/gemma/pkg/config" ) +// StoreUploadedFile stores a file upload file from +// a given HTTP request identified by a given field name +// in a file with a path build by the config.TmpDir and +// the given file name. +// If the file is long than the given limit maxSize +// this function returns an error. func StoreUploadedFile(req *http.Request, field, fname string, maxSize int64) (string, error) { // Check for direct upload.