summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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())