SetContentLengthRange - Set new min and max content length condition for all incoming uploads.
(minLen, maxLen int64)
| 246 | // SetContentLengthRange - Set new min and max content length |
| 247 | // condition for all incoming uploads. |
| 248 | func (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. |
no test coverage detected