Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadToBoundary ¶
func ReadToBoundary(boundary []byte, stream io.ReadCloser, target io.WriteCloser) ([]byte, bool, error)
/ 从流中一直读到文件的末位 / @return []byte 没有写到文件且又属于下一个文件的数据 / @return bool 是否已经读到流的末位了 / @return error 是否发生错误
Types ¶
type FileHeader ¶
type FileHeader struct { ContentDisposition string Name string FileName string ///< 文件名 ContentType string ContentLength int64 }
/ 解析多个文件上传中,每个具体的文件的信息
func ParseFileHeader ¶
func ParseFileHeader(h []byte) (FileHeader, bool)
/ 解析描述文件信息的头部 / @return FileHeader 文件名等信息的结构体 / @return bool 解析成功还是失败
func ParseFromHead ¶
func ParseFromHead(read_data []byte, read_total int, boundary []byte, stream io.ReadCloser) (FileHeader, []byte, error)
/ 解析表单的头部 / @param read_data 已经从流中读到的数据 / @param read_total 已经从流中读到的数据长度 / @param boundary 表单的分割字符串 / @param stream 输入流 / @return FileHeader 文件名等信息头 / []byte 已经从流中读到的部分 / error 是否发生错误
Click to show internal directories.
Click to hide internal directories.