summaryrefslogtreecommitdiff
path: root/src/rhimportd
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2016-04-02 05:59:23 (GMT)
committerChristian Pointner <equinox@helsinki.at>2016-04-02 05:59:23 (GMT)
commitfe9bf93c2d1d65590695e9739ab30a030a66c3b6 (patch)
treecd7792edf20c9f07059e8955a82890cd3e5e0618 /src/rhimportd
parentabc61fa4330ed00a816aa25f9fcd4daeda8a41bd (diff)
better name for upload dir
Diffstat (limited to 'src/rhimportd')
-rw-r--r--src/rhimportd/uploadWeb.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/rhimportd/uploadWeb.go b/src/rhimportd/uploadWeb.go
index e0326ad..978f6cb 100644
--- a/src/rhimportd/uploadWeb.go
+++ b/src/rhimportd/uploadWeb.go
@@ -63,7 +63,7 @@ const (
func webUploadHandler(conf *rhimport.Config, db *rddb.DBChan, sessions *rhimport.SessionStoreChan, trusted bool, w http.ResponseWriter, r *http.Request) {
if r.Method == "GET" {
- http.ServeFile(w, r, "./html/upload-form.html")
+ http.ServeFile(w, r, "./html/upload-form.html") // TODO: hardcoded html-dir... should we print the html directly?
return
}
@@ -117,7 +117,8 @@ func webUploadHandler(conf *rhimport.Config, db *rddb.DBChan, sessions *rhimport
rhl.Printf("WebUploadHandler: got request from user '%s', filename='%s'", username, hdr.Filename)
- dstpath, err := ioutil.TempDir(conf.TempDir, "rhimportd-")
+ // TODO: uploaded files should be deleted after some time... create directory with timestamp as part of the name?
+ dstpath, err := ioutil.TempDir(conf.TempDir, "webupload-"+username+"-")
if err != nil {
rhl.Printf("WebUploadHandler: error creating temporary directory: %v", err)
webUploadErrorResponse(w, http.StatusInternalServerError, err.Error())