summaryrefslogtreecommitdiff
path: root/pkg/api/handlers/compat/images_save.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/api/handlers/compat/images_save.go')
-rw-r--r--pkg/api/handlers/compat/images_save.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/pkg/api/handlers/compat/images_save.go b/pkg/api/handlers/compat/images_save.go
new file mode 100644
index 000000000..b39c719a0
--- /dev/null
+++ b/pkg/api/handlers/compat/images_save.go
@@ -0,0 +1,14 @@
+package compat
+
+import (
+ "io"
+ "net/http"
+ "os"
+)
+
+func SaveFromBody(f *os.File, r *http.Request) error { // nolint
+ if _, err := io.Copy(f, r.Body); err != nil {
+ return err
+ }
+ return f.Close()
+}