Check for errors during file copy

This commit is contained in:
raul 2024-05-03 09:18:23 +02:00
parent 1337789403
commit 3ebe2ab765
1 changed files with 4 additions and 1 deletions

View File

@ -39,7 +39,10 @@ func uploadFile(w http.ResponseWriter, r *http.Request) {
log.Printf("Error happened opening file: %v\n", err) log.Printf("Error happened opening file: %v\n", err)
} }
io.Copy(f, file) _, err = io.Copy(f, file)
if err != nil {
log.Printf("Error happened writing file: %v\n", err)
}
} }
func server() { func server() {