English 中文(简体)
未调用后加载方法上的银纹文件
原标题:Silverstripe File onAfterUpload method not called

我有一个文件的扩展名附加

Object::add_extension( File ,  MyFileDecorator );

我可以确认,扩展类正在创建中,扩展方法 on beforeWrite 运作良好。

然而,尽管有文件声称在文件上载时应该将其调用,但是,我从来没有看到过一个延伸的 " 后装 " / " 代号 " 被调用。

我尝试了使用 FileIframe Field , FileUpload Field (上传) 和各种数据对象管理器分类,但都徒劳无益。

通过 FileIframe Field 查看,似乎没有呼叫 on AfterUpload ,所以我想我的问题是,我是否可以使用一个字段来称呼这个方法?

最佳回答

你说的对,看起来不像有人叫它。叔叔奶酪S FileAttachment Field(踢资产模块的一部分)使用它。它是一个不错的文件上传器,但我相信它只在厘米上有效。您想要在厘米或前端执行吗?

https://github.com/unclecheesese/Kickassassets" rel=“no follow'>https://github.com/unclecheese/Kickassesets

另一种选择是使用 " 后天方法 " 。

问题回答

暂无回答




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签