Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

Commit

Permalink
merge pull-request:44, fix #44
Browse files Browse the repository at this point in the history
  • Loading branch information
codeskyblue committed May 29, 2019
1 parent 79f0529 commit dd1e203
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion httpserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,12 @@ func (server *Server) initHTTPServer() {
// deprecated
m.HandleFunc("/install", func(w http.ResponseWriter, r *http.Request) {
var url = r.FormValue("url")
filepath := TempFileName("/sdcard/tmp", ".apk")
var tmpdir = r.FormValue("tmpdir")
if tmpdir == "" {
tmpdir = "/data/local/tmp"
}

filepath := TempFileName(tmpdir, ".apk")
key := background.HTTPDownload(url, filepath, 0644)
go func() {
defer os.Remove(filepath) // release sdcard space
Expand Down

0 comments on commit dd1e203

Please sign in to comment.