#Download

1 articles

18 How to Download File in Golang

18 How to Download File in Golang

Download Files

Apart from uploading files, we also need or need a page that can download files or something on our website. The Golang library provides FileServer and ServeFile. If we want to force the file to be downloaded without having to be rendered by the browser then we can use the Content-Disposition header. More details can be seen on this page https://developer.mozilla.org/en-US/docs/Web/Headers/Content-Disposition.