MCPcopy
hub / github.com/minio/minio-go / SetContentLengthRange

Method SetContentLengthRange

post-policy.go:248–261  ·  view source on GitHub ↗

SetContentLengthRange - Set new min and max content length condition for all incoming uploads.

(minLen, maxLen int64)

Source from the content-addressed store, hash-verified

246// SetContentLengthRange - Set new min and max content length
247// condition for all incoming uploads.
248func (p *PostPolicy) SetContentLengthRange(minLen, maxLen int64) error {
249 if minLen > maxLen {
250 return errInvalidArgument("Minimum limit is larger than maximum limit.")
251 }
252 if minLen < 0 {
253 return errInvalidArgument("Minimum limit cannot be negative.")
254 }
255 if maxLen <= 0 {
256 return errInvalidArgument("Maximum limit cannot be non-positive.")
257 }
258 p.contentLengthRange.min = minLen
259 p.contentLengthRange.max = maxLen
260 return nil
261}
262
263// SetSuccessActionRedirect - Sets the redirect success url of the object for this policy
264// based upload.

Calls 1

errInvalidArgumentFunction · 0.85

Tested by

no test coverage detected