用go 实现下载功能

SLonger · · 5692 次点击
恩, 解决了,用了ServeFile() 实现服务器文件下载,上面个代码好像只能在网页上打开,没法下载,非常感谢^.^
#3
更多评论
试试这个 package main import ( "net/http" ) func main() { http.Handle("/", http.FileServer(http.Dir("./"))) http.ListenAndServe(":8123", nil) } 不行就自行百度golang 文件服务器
#1
你说的应该就是静态服务器吧
#2