mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
Feat: CORS / Test: site/config route
This commit is contained in:
@@ -2,41 +2,9 @@ package local
|
||||
|
||||
import (
|
||||
"io"
|
||||
"mime/multipart"
|
||||
)
|
||||
|
||||
// FileData 上传的文件数据
|
||||
type FileData struct {
|
||||
File multipart.File
|
||||
Size uint64
|
||||
Name string
|
||||
MIMEType string
|
||||
}
|
||||
|
||||
func (file FileData) Read(p []byte) (n int, err error) {
|
||||
return file.File.Read(p)
|
||||
}
|
||||
|
||||
func (file FileData) GetMIMEType() string {
|
||||
return file.MIMEType
|
||||
}
|
||||
|
||||
func (file FileData) GetSize() uint64 {
|
||||
return file.Size
|
||||
}
|
||||
|
||||
func (file FileData) Close() error {
|
||||
return file.File.Close()
|
||||
}
|
||||
|
||||
func (file FileData) GetFileName() string {
|
||||
return file.Name
|
||||
}
|
||||
|
||||
func (file FileData) GetVirtualPath() string {
|
||||
return file.Name
|
||||
}
|
||||
|
||||
// FileStream 用户传来的文件
|
||||
type FileStream struct {
|
||||
File io.ReadCloser
|
||||
Size uint64
|
||||
|
||||
Reference in New Issue
Block a user