Procházet zdrojové kódy

added cache handling function

master
Patrick Peng Sun před 9 roky
rodič
revize
0251b896ae
1 změnil soubory, kde provedl 4 přidání a 0 odebrání
  1. +4
    -0
      server.go

+ 4
- 0
server.go Zobrazit soubor

@@ -191,6 +191,10 @@ func uploadHandler(w http.ResponseWriter, r *http.Request) {
func crmAttachmentHandler(w http.ResponseWriter, r *http.Request) {
fileID := getCrmFileID(r.URL.Path)
saveAs := GlobalPath.CRMAttachment + "crm_attach_" + fileID //add prefix for easy deleting
if isFileExist(saveAs) {
http.ServeFile(w, r, saveAs)
return
}
if fileID == "" {
log.Println("invalid fileID")
response404Handler(w)

Načítá se…
Zrušit
Uložit