防止上传文件 OnFileManagerUpload

问题描述

我可以通过处理 OnFileManagerUpload 事件来阻止通过 MODX 文件管理器上传文件吗?

问题是我想在加载时强制将图像转换为 webp,所以我不想拥有原始图像。

解决方法

请查看这篇文章 https://modx.pro/development/16940,在这里您可以找到如何处理文件的详细信息,您还应该将 webp-convert 库 https://github.com/rosell-dk/webp-convert 包含到插件中,并即时将图像转换为 webp。

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...