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


PHP Uploader::imageFile2attach方法代码示例

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


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

示例1: uploadPic

 public function uploadPic($request, $response)
 {
     /*{{{*/
     $thesisId = $request->thesisId;
     $file = $_FILES['file'];
     $user = $this->curOperatorUser;
     $filePath = '';
     if ($file['error'] == 0) {
         $attach = Uploader::imageFile2attach($user, $file, Attachment::TYPE_JPG, $user->id, Attachment::HOSTTYPE_HDFADMIN);
         if ($attach instanceof Attachment) {
             $filePath = $attach->filePath;
         }
     }
     if ($filePath) {
         ThesisClient::getInstance()->modifyThesisPicurl($thesisId, $filePath);
     }
     $msg = '文章图片修改成功';
     $url = $response->router->urlfor('thesis/modifypic', array('msg' => $msg, 'thesisId' => $thesisId));
     $response->setRedirect($url);
 }
开发者ID:sdgdsffdsfff,项目名称:hdf-client,代码行数:20,代码来源:thesiscontroller.php

示例2: uploadPic

 public function uploadPic($request, $response)
 {
     /*{{{*/
     $paperId = $request->paperId;
     $type = empty($request->type) ? $request->type : "";
     $file = $_FILES['file'];
     $user = $this->curOperatorUser;
     $filePath = '';
     if ($file['error'] == 0) {
         $attach = Uploader::imageFile2attach($user, $file, Attachment::TYPE_JPG, $user->id, Attachment::HOSTTYPE_HDFADMIN);
         if ($attach instanceof Attachment) {
             $filePath = $attach->filePath;
         }
     }
     if ($filePath) {
         if (empty($type)) {
             PaperClient::getInstance()->modifyPaperPicurl($paperId, $filePath);
         } else {
             PaperClient::getInstance()->modifyPaperAdPicurl($paperId, $filePath);
         }
     }
     $msg = '专题图片修改成功';
     $url = $response->router->urlfor('paper/modifypic', array('msg' => $msg, 'paperId' => $paperId, 'type' => $type));
     $response->setRedirect($url);
 }
开发者ID:sdgdsffdsfff,项目名称:hdf-client,代码行数:25,代码来源:papercontroller.php

示例3: uploadAttachmentPost

 public function uploadAttachmentPost($request, $response)
 {
     /*{{{*/
     $file = $_FILES['file'];
     $projectOperator = $this->myProjectOperator;
     $user = $projectOperator->user;
     $filePath = '';
     if ($file['error'] == 0) {
         $attachment = Uploader::imageFile2attach($user, $file, Attachment::TYPE_JPG, 0, 'WxArticle');
         if ($attachment instanceof Attachment) {
             WxMgrClient::getInstance()->modifyWxArticleAttachment($request->wxArticleId, $attachment->id);
         }
     }
     $response->setRedirect("/wxmgr/modifywxarticle?wxArticleId={$request->wxArticleId}&preMsg=" . urlencode('修改成功'));
 }
开发者ID:sdgdsffdsfff,项目名称:hdf-client,代码行数:15,代码来源:wxmgrcontroller.php

示例4: uploadPic

 public function uploadPic($request, $response)
 {
     /*{{{*/
     $articleId = $request->articleId;
     $file = $_FILES['file'];
     $user = $this->curOperatorUser;
     $filePath = "";
     if ($file['error'] == 0) {
         $attach = Uploader::imageFile2attach($user, $file, Attachment::TYPE_JPG, $user->id, Attachment::HOSTTYPE_HDFADMIN);
         if ($attach instanceof Attachment) {
             $filePath = $attach->filePath;
         }
     }
     if ($filePath) {
         ArticleClient::getInstance()->modifyArticlePicUrl($articleId, $filePath, $user->id);
     }
     $msg = 'ндубм╪ф╛пч╦дЁи╧╕';
     $url = $response->router->urlfor('article/modifypic', array('msg' => $msg, 'articleId' => $articleId));
     $response->setRedirect($url);
 }
开发者ID:sdgdsffdsfff,项目名称:hdf-client,代码行数:20,代码来源:articlecontroller.php


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