aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/upload/upload.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/upload/upload.go')
-rw-r--r--pkg/upload/upload.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/upload/upload.go b/pkg/upload/upload.go
index aff7803..1576431 100644
--- a/pkg/upload/upload.go
+++ b/pkg/upload/upload.go
@@ -10,6 +10,7 @@ import (
"path/filepath"
"strings"
+ "github.com/LMBishop/scrapbook/pkg/config"
"github.com/LMBishop/scrapbook/pkg/index"
)
@@ -19,6 +20,10 @@ func HandleUpload(siteName string, reader *multipart.Reader, index *index.SiteIn
return "", fmt.Errorf("no such site: %s", siteName)
}
+ if s.SiteConfig.Flags&config.FlagReadOnly != 0 {
+ return "", fmt.Errorf("site is read only: %s", siteName)
+ }
+
temp, err := os.CreateTemp(os.TempDir(), "scrapbook")
if err != nil {
return "", fmt.Errorf("failed to create temporary file: %w", err)