Skip to content
Snippets Groups Projects
Commit f164bc80 authored by ale's avatar ale
Browse files

use ioutil.TempFile

parent d7d4b728
Branches
No related tags found
No related merge requests found
......@@ -4,6 +4,7 @@ import (
"encoding/json"
// "fmt"
"io"
"io/ioutil"
"log"
"net/http"
"os"
......@@ -13,7 +14,6 @@ import (
"git.autistici.org/ale/djrandom/api"
db_client "git.autistici.org/ale/djrandom/services/database/client"
"git.autistici.org/ale/djrandom/util"
"github.com/gorilla/mux"
)
......@@ -32,7 +32,7 @@ func Upload(w http.ResponseWriter, r *djRequest) {
// Create a local temporary file, and copy the request body to
// it. As soon as this is done, return an 'ok' response to the
// client (and process the file in the background).
tmpf, err := util.TempFile("djrandom-upload-", "")
tmpf, err := ioutil.TempFile("", "djrandom_upload_")
if err != nil {
log.Printf("Upload(): Error creating temporary file: %s", err)
http.Error(w, "Internal Server Error", http.StatusInternalServerError)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment