Don't prepend temp, use subdir
This commit is contained in:
parent
2325074547
commit
7d59377309
@ -97,6 +97,17 @@ func uploadHandler(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
modifiedArches := make(map[string]bool)
|
||||
|
||||
baseDir := path.Join(os.TempDir(), "deb-simple")
|
||||
|
||||
if _, err := os.Stat(baseDir); err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
if err := os.MkdirAll(baseDir, 0755); err != nil {
|
||||
httpErrorf(w, "error creating path: %s", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for {
|
||||
part, err := reader.NextPart()
|
||||
|
||||
@ -108,7 +119,7 @@ func uploadHandler(w http.ResponseWriter, r *http.Request) {
|
||||
continue
|
||||
}
|
||||
|
||||
tempFile := path.Join(os.TempDir(), "temp_" + part.FileName())
|
||||
tempFile := path.Join(baseDir, part.FileName())
|
||||
|
||||
dst, err := os.Create(tempFile)
|
||||
|
||||
|
@ -15,7 +15,7 @@ import (
|
||||
"github.com/go-ini/ini"
|
||||
)
|
||||
|
||||
var VERSION string = "1.3.2"
|
||||
var VERSION string = "1.3.3"
|
||||
|
||||
func packageName(name string) string {
|
||||
if index := strings.Index(name, "_"); index != -1 {
|
||||
|
Loading…
Reference in New Issue
Block a user