是否有办法限制视频秒在火场存储?例如,如果用户上传30秒视频,那么禁用上传视频或在15秒切割。这个是可能的吗?
发布于 2018-08-27 14:16:42
Firebase存储不知道存储的内容类型。如果你上传视频到它,它不会以任何方式解析视频。因此,它不能拒绝(或截断)上传后,一定的视频持续时间已经上传。
它所能做的就是根据上传的大小拒绝,如服务器端安全规则的防火墙文档所示
// Allow write files to the path "images/*", subject to the constraints:
// 1) File is less than 5MB
// 2) Content type is an image
// 3) Uploaded content type matches existing content type
// 4) File name (stored in imageId wildcard variable) is less than 32 characters
match /{imageId} {
allow write: if request.resource.size < 5 * 1024 * 1024
&& request.resource.contentType.matches('image/.*')
&& request.resource.contentType == resource.contentType
&& imageId.size() < 32如果你想要更具体的东西,你必须:
https://stackoverflow.com/questions/52037952
复制相似问题