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


PHP qqFileUploader::upload方法代码示例

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


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

示例1: date

     $UserData->hide_online = 1;
 } else {
     $UserData->hide_online = 0;
 }
 if (isset($_POST['DeletePhoto'])) {
     $UserData->removeFile();
 }
 if (isset($_FILES["UserPhoto"]) && is_uploaded_file($_FILES["UserPhoto"]["tmp_name"]) && $_FILES["UserPhoto"]["error"] == 0 && erLhcoreClassImageConverter::isPhoto('UserPhoto')) {
     $UserData->removeFile();
     $dir = 'var/userphoto/' . date('Y') . 'y/' . date('m') . '/' . date('d') . '/' . $UserData->id . '/';
     erLhcoreClassChatEventDispatcher::getInstance()->dispatch('user.edit.photo_path', array('dir' => &$dir, 'storage_id' => $UserData->id));
     $response = erLhcoreClassChatEventDispatcher::getInstance()->dispatch('user.edit.photo_store', array('file_post_variable' => 'UserPhoto', 'dir' => &$dir, 'storage_id' => $UserData->id));
     // There was no callbacks
     if ($response === false) {
         erLhcoreClassFileUpload::mkdirRecursive($dir);
         $file = qqFileUploader::upload($_FILES, 'UserPhoto', $dir);
     } else {
         $file = $response['data'];
     }
     if (!empty($file["errors"])) {
         foreach ($file["errors"] as $err) {
             $Errors[] = $err;
         }
     } else {
         $UserData->removeFile();
         $UserData->filename = $file["data"]["filename"];
         $UserData->filepath = $file["data"]["dir"];
         $response = erLhcoreClassChatEventDispatcher::getInstance()->dispatch('user.edit.photo_resize_150', array('mime_type' => $file["data"]['mime_type'], 'user' => $UserData));
         if ($response === false) {
             erLhcoreClassImageConverter::getInstance()->converter->transform('photow_150', $UserData->file_path_server, $UserData->file_path_server);
             chmod($UserData->file_path_server, 0644);
开发者ID:nagyistoce,项目名称:livehelperchat,代码行数:31,代码来源:edit.php

示例2: validateUserPhoto

 public static function validateUserPhoto(&$userData, $params = array())
 {
     $Errors = false;
     if (isset($_FILES["UserPhoto"]) && is_uploaded_file($_FILES["UserPhoto"]["tmp_name"]) && $_FILES["UserPhoto"]["error"] == 0 && erLhcoreClassImageConverter::isPhoto('UserPhoto')) {
         $Errors = array();
         $dir = 'var/userphoto/' . date('Y') . 'y/' . date('m') . '/' . date('d') . '/' . $userData->id . '/';
         erLhcoreClassChatEventDispatcher::getInstance()->dispatch('user.edit.photo_path', array('dir' => &$dir, 'storage_id' => $userData->id));
         $response = erLhcoreClassChatEventDispatcher::getInstance()->dispatch('user.edit.photo_store', array('file_post_variable' => 'UserPhoto', 'dir' => &$dir, 'storage_id' => $userData->id));
         // There was no callbacks
         if ($response === false) {
             erLhcoreClassFileUpload::mkdirRecursive($dir);
             $file = qqFileUploader::upload($_FILES, 'UserPhoto', $dir);
         } else {
             $file = $response['data'];
         }
         if (!empty($file["errors"])) {
             foreach ($file["errors"] as $err) {
                 $Errors[] = $err;
             }
         } else {
             $userData->removeFile();
             $userData->filename = $file["data"]["filename"];
             $userData->filepath = $file["data"]["dir"];
             $response = erLhcoreClassChatEventDispatcher::getInstance()->dispatch('user.edit.photo_resize_150', array('mime_type' => $file["data"]['mime_type'], 'user' => $userData));
             if ($response === false) {
                 erLhcoreClassImageConverter::getInstance()->converter->transform('photow_150', $userData->file_path_server, $userData->file_path_server);
                 chmod($userData->file_path_server, 0644);
             }
         }
     }
     return $Errors;
 }
开发者ID:detain,项目名称:livehelperchat,代码行数:32,代码来源:lhuservalidator.php


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