func PostedFiles(r *http.Request, opts ...PostedFileOption) ([]PostedFile, error) {
	var files []PostedFile

	options := PostedFilesOptions{
		MaxMemory:          DefaultPostedFilesMaxMemory,
		ParseMultipartForm: true,
		ParseForm:          false,
	}
	for _, opt := range opts {
		opt(&options)
	}

	if options.ParseMultipartForm {
		if err := r.ParseMultipartForm(options.MaxMemory); err != nil {
			return nil, ex.New(err)
		}
		for key := range r.MultipartForm.File {
			file, err := readPostedFile(r, key)
			if err != nil {
				return nil, err
			}
			files = append(files, *file)
		}
	}
	if options.ParseForm {
		if err := r.ParseForm(); err != nil {
			return nil, ex.New(err)
		}
		for key := range r.PostForm {
			file, err := readPostedFile(r, key)
			if err != nil {
				return nil, err
			}
			files = append(files, *file)
		}
	}
	return files, nil
}
// PostedFiles returns any files posted to the request.
//
// The files are held in memory, if you need to stream the files out because they may be large,
// you should use the `*net/http.Request.FormFile(...)` function directly instead of this method.
PostedFiles returns any files posted to the request.

The files are held in memory, if you need to stream the files out because they may be large,
you should use the `*net/http.Request.FormFile(...)` function directly instead of this method.
// PostedFiles returns any files posted to the request . // // The files are held in memory if you need to stream the files out because they may be large // you should use the ` * net / http . Request . FormFile ( ... ) ` function directly instead of this method .
func PostedFiles(r *http.Request, opts ...PostedFileOption) ([]PostedFile, error) {
	var files []PostedFile
	options := PostedFilesOptions{
		MaxMemory:          DefaultPostedFilesMaxMemory,
		ParseMultipartForm: true,
		ParseForm:          false,
	}
	for _, opt := range opts {
		opt(&options)
	}
	if options.ParseMultipartForm {
		if err := r.ParseMultipartForm(options.MaxMemory); err != nil {
			return nil, ex.New(err)
		}
		for key := range r.MultipartForm.File {
			file, err := readPostedFile(r, key)
			if err != nil {
				return nil, err
			}
			files = append(files, *file)
		}
	}
	if options.ParseForm {
		if err := r.ParseForm(); err != nil {
			return nil, ex.New(err)
		}
		for key := range r.PostForm {
			file, err := readPostedFile(r, key)
			if err != nil {
				return nil, err
			}
			files = append(files, *file)
		}
	}
	return files, nil
}
func PostedFiles ( r * http . Request , opts ... PostedFileOption ) ( [ ] PostedFile , error ) { var files [ ] PostedFile options := PostedFilesOptions { MaxMemory : DefaultPostedFilesMaxMemory , ParseMultipartForm : true , ParseForm : false , } for _ , opt := range opts { opt ( & options ) } if options . ParseMultipartForm { if err := r . ParseMultipartForm ( options . MaxMemory ) ; err != nil { return nil , ex . New ( err ) } for key := range r . MultipartForm . File { file , err := readPostedFile ( r , key ) if err != nil { return nil , err } files = append ( files , * file ) } } if options . ParseForm { if err := r . ParseForm ( ) ; err != nil { return nil , ex . New ( err ) } for key := range r . PostForm { file , err := readPostedFile ( r , key ) if err != nil { return nil , err } files = append ( files , * file ) } } return files , nil }
PostedFiles returns any files posted to the request.
PostedFiles returns any files posted to the request .