当前位置: 首页>>代码示例>>PHP>>正文


PHP UploadField::upload方法代码示例

本文整理汇总了PHP中UploadField::upload方法的典型用法代码示例。如果您正苦于以下问题:PHP UploadField::upload方法的具体用法?PHP UploadField::upload怎么用?PHP UploadField::upload使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UploadField的用法示例。


在下文中一共展示了UploadField::upload方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: upload

 /**
  * Action to handle upload of a single file
  *
  * @param SS_HTTPRequest $request
  * @return SS_HTTPResponse
  * @return SS_HTTPResponse
  */
 public function upload(SS_HTTPRequest $request)
 {
     // Find the first set of upload data that looks like it came from an
     // UploadField.
     // NOTE(Jake): There is only the SecurityID and the 'upload' data as this is done
     //             in it's own AJAX request, not sent along with all the other data.
     foreach ($request->postVars() as $key => $value) {
         // todo(Jake): Test SS 3.1 compatibility
         // NOTE(Jake): Only tested in SS 3.2, UploadField::upload data may not look like this in 3.1...
         if ($value && isset($value['name']) && isset($value['type']) && isset($value['tmp_name'])) {
             // NOTE(Jake): UploadField requires this FormField to be the correct name so it can retrieve
             //             the file information from postVar. So detect the first set of data that seems
             //             like upload info and use it.
             $this->setName($key);
             break;
         }
     }
     return parent::upload($request);
 }
开发者ID:silbinarywolf,项目名称:multirecordfield,代码行数:26,代码来源:MultiRecordUploadField.php


注:本文中的UploadField::upload方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。