gpt4 book ai didi

file - 去)我如何进行下载服务?

转载 作者:数据小太阳 更新时间:2023-10-29 03:16:01 25 4
gpt4 key购买 nike

<分区>

我做上传服务器但是我不能做下载服务器

package main

import (
"fmt"
"io"
"os"

"github.com/gin-gonic/gin"
)

func uploadHandler(c *gin.Context) {
uid := c.Request.FormValue("uid")
file, header, err := c.Request.FormFile("uploadFile")
filename := header.Filename
fmt.Println(filename)
err = os.Mkdir("./upload/"+uid, 777)
out, err := os.Create("./upload/" + uid + "/" + filename)
_, err = io.Copy(out, file)
}

func main() {
r := gin.Default()
r.POST("/goupload", uploadHandler)
r.POST("/godownload", downloadHandler)
// listen and server on 0.0.0.0:8080
r.Run()
}

那么,我该如何制作下载服务器呢?

我将使用 post uid 和 downloadfilename。

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com