recordinggggggggggggg...

This commit is contained in:
Arkaprabha Chakraborty
2025-11-01 08:19:43 +05:30
parent 7a72b66620
commit 5871d9f8cf
6 changed files with 465 additions and 67 deletions

View File

@@ -409,6 +409,16 @@ func handleFileServe(w http.ResponseWriter, r *http.Request) {
return
}
// Check if file exists
if _, err := os.Stat(filePath); os.IsNotExist(err) {
http.Error(w, "File not found", http.StatusNotFound)
return
}
// Set headers to force download
w.Header().Set("Content-Disposition", fmt.Sprintf("attachment; filename=\"%s\"", filename))
w.Header().Set("Content-Type", "application/octet-stream")
// Serve the file
http.ServeFile(w, r, filePath)
}