diff --git a/main.go b/main.go index b9ee13b..a4f0a7e 100644 --- a/main.go +++ b/main.go @@ -79,6 +79,13 @@ func printImage(w http.ResponseWriter, r *http.Request) { return } + err = os.Remove(imagePath) + if err != nil { + log.Printf("Error removing file: %s\n", err) + http.Error(w, "Failed to remove the file", http.StatusInternalServerError) + return + } + fmt.Fprintf(w, "Print request processed successfully.\n%s\n", output) }