[scode]原文:https://discuss.flarum.org/d/4154
作者:luceos
翻译:Golden[/scode]
Upload by FriendsOfflarum
一个为您的论坛(flarum)智能处理文件上传的扩展程序。您需要安装 PHP 扩展 exif 后方可上传图片。
功能
-
图片上传
- 自动水印。
- 自动缩放
- 使用 MIME 限定文件上传类型。
- 本地、第三方存储服务支持(imgur、AWS S3、七牛云)。
- 支持拖拽、粘贴上传。
- 支持批量上传文件(按钮、拖拽上传均支持)。
- 易扩展性,本扩展高度依赖于事件。
安装
通过巴扎市场或 composer 手动安装:
composer require fof/upload
升级
composer require fof/upload
php flarum migrate
php flarum cache:clear
从 Flagrow 版本升级
本扩展是旧版 Flagrow Upload 的替代。
要从旧扩展升级到当前版本:
- 备份数据库!您应该备份好数据库以及所有上传的文件。
-
确保您当前是 Flagrow Upload 的最新版本,请运行:
composer require flagrow/upload composer show flagrow/upload # You should see "versions: * 0.7.1" on the 4th line of output php flarum migrate
- 在后台禁用上传插件。
-
运行:
composer require fof/upload
Composer 应该会输出
flagrow/upload
已经被自动删除的信息。
- 在后台开启新版上传插件。
- 您此前旧版本的设置、上传元数据将会自动合并到 FoF Upload 旗下。
- 帖子中的文件插入代码会自动更新为 FoF 头,这意味着您不需要删除他们。
设置
启用插件,新选项卡将会出现在左侧菜单栏。此设置页面可以让您进一步配置扩展程序。
请确保同时在权限页面上配置上传权限。
文件模板
文件模板详情请查看插件设置里的说明。这里注意一下,模板是由处理优先级的,同一个 MIME 类型文件,最上层的文件模板会覆盖掉下层设置的文件模板。
Mimetype 正则表达式
正则表达式使您拥有很大的自由度,但是它们也很难理解。这里有一些提示,您随时可以在 Flarum 官方论坛上寻求帮助。
-
如果要允许所有常规文件类型,包括视频、音乐、压缩文件和图像,请使用以下命令:
(video\/(3gpp|mp4|mpeg|quicktime|webm))|(audio\/(aiff|midi|mpeg|mp4))|(image\/(gif|jpeg|png))|(application\/(x-(7z|rar|zip)-compressed|zip|arj|x-(bzip2|gzip|lha|stuffit|tar)|pdf))
-
如果您需要允许上传所有图片文件,请使用通配符:
^image\/.*
MIME 类型由 主要类型 + 次要类型 组成。主类型可以是
image
video
application
png
pdf
/
\/
。
有关 MIME 类型,可以查看
MDN 文档
另外请注意,您添加的规则是有优先级的,最先添加的规则,优先级最高:
常见问题
- AWS S3 配置:请阅读 AWS S3 配置页面
- 启用插件、上传图片报错:请检查是否安装了 PHP 的扩展 exif
链接
FriendsOfflarum 制作扩展
What side effects can this medication cause? All trends of medicament.
get mobic no prescription
Definitive journal of drugs and therapeutics. Some trends of drugs.
Get warning information here. Get here.
can i purchase mobic pills
Actual trends of drug. All trends of medicament.
Some are medicines that help people when doctors prescribe. Drugs information sheet.
https://stromectolst.com/# stromectol medicine
Definitive journal of drugs and therapeutics. Commonly Used Drugs Charts.
Read now. All trends of medicament.
ivermectin 250ml
Prescription Drug Information, Interactions & Side. Everything information about medication.
Drugs information sheet. Drugs information sheet.
ivermectin 1 cream generic
п»їMedicament prescribing information. Read information now.
Hello. And Bye Bye Bye.