[#6792] added filesystem.System.GetReuploadableFile method

This commit is contained in:
Gani Georgiev
2025-05-03 18:36:16 +03:00
parent 7ffe9f63a5
commit e80d64414b
5 changed files with 3658 additions and 3498 deletions

View File

@@ -176,6 +176,18 @@ func (r *bytesReadSeekCloser) Close() error {
// -------------------------------------------------------------------
var _ FileReader = (openFuncAsReader)(nil)
// openFuncAsReader defines a FileReader from a bare Open function.
type openFuncAsReader func() (io.ReadSeekCloser, error)
// Open implements the [filesystem.FileReader] interface.
func (r openFuncAsReader) Open() (io.ReadSeekCloser, error) {
return r()
}
// -------------------------------------------------------------------
var extInvalidCharsRegex = regexp.MustCompile(`[^\w\.\*\-\+\=\#]+`)
const randomAlphabet = "abcdefghijklmnopqrstuvwxyz0123456789"