diff options
| author | Julian Hurst <ark@mansus.space> | 2023-08-10 17:02:00 +0200 |
|---|---|---|
| committer | Julian Hurst <ark@mansus.space> | 2023-08-10 17:02:00 +0200 |
| commit | 1d47646d99e7da71d04c49b0d16bfb21ecf78308 (patch) | |
| tree | 0d5f3950ded04ad6ff83335050481bbbb519ffa8 /imgs.go | |
| parent | e0444c96749d016b003443087481c67592a4893d (diff) | |
| download | docspace-1d47646d99e7da71d04c49b0d16bfb21ecf78308.tar.gz | |
Support a custom docs folder path (-f option)
Diffstat (limited to 'imgs.go')
| -rw-r--r-- | imgs.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -58,7 +58,7 @@ func imgs(w http.ResponseWriter, r *http.Request) { //}) start := page * pageSize //imgs := extractImgs(files, start) - imgs, err := extractImgsGlob(userDocPath) + imgs, err := extractImgsGlob(userDocPath, username) if err != nil { sendError(w, r, err.Error(), http.StatusInternalServerError) return @@ -105,7 +105,7 @@ func imgs(w http.ResponseWriter, r *http.Request) { unauthorized(w, r) } -func extractImgsGlob(userDocPath string) ([]Doc, error) { +func extractImgsGlob(userDocPath string, username string) ([]Doc, error) { var typs []string = []string { "image/jpeg", "image/png", @@ -142,7 +142,7 @@ func extractImgsGlob(userDocPath string) ([]Doc, error) { info.Name(), humanize(info.Size()), info.ModTime(), - path.Join(userDocPath, info.Name()), + path.Join("/docs/", username, info.Name()), }) } } |
