fix
fix the content-Type to PreviewContract
| | |
| | | //reader := bytes.NewReader(contract.FileContent) |
| | | //c.DataFromReader(http.StatusOK, int64(len(contract.FileContent)), "application/pdf", reader, map[string]string{"Content-Disposition": fmt.Sprintf("attachment; filename=%s", contract.FileName)}) |
| | | reader := bytes.NewReader(contract.FileContent) |
| | | c.Writer.Header().Set("Content-Type", "application/pdf") |
| | | c.Header("Content-Type", contract.FileType) |
| | | c.Writer.Header().Set("Content-Disposition", "inline; filename="+contract.FileName) |
| | | http.ServeContent(c.Writer, c.Request, contract.FileName, time.Now(), reader) |
| | | } |