04_file_upload

command
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2025 License: MIT Imports: 5 Imported by: 0

README

文件上传示例

展示如何处理文件上传,包括单文件和多文件上传。

功能

  • 单文件上传
  • 多文件上传
  • 文件元信息记录

准备上传目录

mkdir -p uploads

运行

go run main.go

测试

单文件上传
curl -X POST http://localhost:8080/upload/single \
  -F "file=@/path/to/your/file.txt"
多文件上传
curl -X POST http://localhost:8080/upload/multiple \
  -F "files=@/path/to/file1.txt" \
  -F "files=@/path/to/file2.txt"

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL