我是 Golang 的新手。我用 a link读取 xlsx 文件:
filePath := "controllers\\foo.xlsx"
xlFile, err := xlsx.OpenFile(filePath)
if err != nil {
log.Fatal(err)
}
我的程序在window os 上运行。
提前致谢。
最佳答案
用这个 :
file, fileHeader, err := req.FormFile("theAttachmentfile")
if err != nil {
do what you wanna do
}
xlsx, err := excelize.OpenReader(file)
if err != nil {
do what you wanna do
}
关于go - 如何修复 Go 中的 "zip: not a valid zip file"错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55832497/