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


PHP Zend_File_Transfer_Adapter_Http::getFilename方法代码示例

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


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

示例1: handleUploadedFile

 /**
  * Handle the uploaded file
  * 
  * @return string|boolean
  */
 public function handleUploadedFile()
 {
     $upload = new Zend_File_Transfer_Adapter_Http();
     $target = $this->getTargetFilename($upload->getFilename());
     $upload->addFilter(new Zend_Filter_File_Rename(array('target' => $target)));
     return $upload->receive() ? $target : false;
 }
开发者ID:vecbralis,项目名称:magento-nedis-import,代码行数:12,代码来源:Catalog.php

示例2: editproductsAction

 function editproductsAction()
 {
     $system = new Admin_Model_Products();
     if ($this->_request->isPost()) {
         $this->view->purifier = Zend_Registry::get('purifier');
         $conf = HTMLPurifier_Config::createDefault();
         $purifier = new HTMLPurifier($conf);
         $menu_id = $purifier->purify($this->_request->getParam('parent_id'));
         $title = $purifier->purify($this->_request->getParam('title'));
         $dis = $purifier->purify($this->_request->getParam('dis'));
         $key = $purifier->purify($this->_request->getParam('key'));
         $description = $purifier->purify($this->_request->getParam('description'));
         $home = $purifier->purify($this->_request->getParam('home'));
         $position = $purifier->purify($this->_request->getParam('position'));
         $active = $purifier->purify($this->_request->getParam('active'));
         $content = $purifier->purify($this->_request->getParam('content'));
         $price = $purifier->purify($this->_request->getParam('price'));
         $state = $purifier->purify($this->_request->getParam('state'));
         $sales = $purifier->purify($this->_request->getParam('sales'));
         $code = $purifier->purify($this->_request->getParam('code'));
         $members = $purifier->purify($this->_request->getParam('members'));
         $dictrict_id = $purifier->purify($this->_request->getParam('dictrict_id'));
         $type = $purifier->purify($this->_request->getParam('type'));
         $category_id = $purifier->purify($this->_request->getParam('category_id'));
         $img = $purifier->purify($this->_request->getParam('images'));
         $test = $_FILES['images']['name'];
         if ($test == '') {
             $images123 = $purifier->purify($this->_request->getParam('images_hiden'));
         } else {
             $upload = new Zend_File_Transfer_Adapter_Http();
             $images = $upload->getFilename();
             $images = basename($images);
             $random_digit = rand(00, 99999);
             $img = $random_digit . $images;
             $filterRename = new Zend_Filter_File_Rename(array('target' => 'Upload/' . $random_digit . $images, 'overwrite' => false));
             $upload->addFilter($filterRename);
             $upload->receive();
             $images123 = $img;
         }
         $id = $this->_request->getParam('id');
         $system->update_products($title, $description, $images123, $content, $menu_id, $price, $state, $sales, $dis, $key, $position, $active, $home, $code, $members, $dictrict_id, $type, $category_id, $id);
     }
     $id = $this->_request->getParam('id');
     $edit = $system->list_products_1($id);
     $this->view->books = $edit;
     $this->view->id = $this->_request->getParam('id');
     $this->view->menu_id = $this->_request->getParam('menu_id');
     $dt = new Admin_Model_Category();
     $district = $dt->option_dictrict();
     $this->view->bokk = $district;
     $menu = $dt->option_menu();
     $this->view->bookss = $menu;
     $mn = $dt->list_menu_1($this->_request->getParam('menu_id'));
     $this->view->book_s = $mn;
 }
开发者ID:lynguyetvan88,项目名称:kemsakura,代码行数:55,代码来源:ProductController.php

示例3: editpagesAction

 function editpagesAction()
 {
     $system = new Admin_Model_Page();
     $paginator = Zend_Paginator::factory($system->option_page());
     $paginator->setItemCountPerPage(15);
     $paginator->setPageRange(10);
     $currentPage = $this->_request->getParam('page', 1);
     $paginator->setCurrentPageNumber($currentPage);
     $this->view->bookss = $paginator;
     if ($this->_request->isPost()) {
         $this->view->purifier = Zend_Registry::get('purifier');
         $conf = HTMLPurifier_Config::createDefault();
         $purifier = new HTMLPurifier($conf);
         $menu = $purifier->purify($this->_request->getParam('menu'));
         $dis = $purifier->purify($this->_request->getParam('dis'));
         $title = $purifier->purify($this->_request->getParam('title'));
         $key = $purifier->purify($this->_request->getParam('key'));
         $description = $purifier->purify($this->_request->getParam('description'));
         $position = $purifier->purify($this->_request->getParam('position'));
         $active = $purifier->purify($this->_request->getParam('active'));
         $home = $purifier->purify($this->_request->getParam('home'));
         $address = $purifier->purify($this->_request->getParam('address'));
         $content = stripslashes($this->_request->getParam('content'));
         $img = $purifier->purify($this->_request->getParam('images'));
         $test = $_FILES['images']['name'];
         if ($test == '') {
             $images123 = $purifier->purify($this->_request->getParam('images_hiden'));
         } else {
             $upload = new Zend_File_Transfer_Adapter_Http();
             $images = $upload->getFilename();
             $images = basename($images);
             $random_digit = rand(00, 99999);
             $img = $random_digit . $images;
             $filterRename = new Zend_Filter_File_Rename(array('target' => 'Upload/' . $img, 'overwrite' => false));
             $upload->addFilter($filterRename);
             $upload->receive();
             $img_1_2 = APPLICATION_PATH . "/../Upload/{$img}";
             $img_2 = time() . ".png";
             $img_2_2 = APPLICATION_PATH . "/../Upload/{$img_2}";
             rename($img_1_2, $img_2_2);
             $images123 = $img_2;
         }
         $id = $this->_request->getParam('id');
         $system->update_Pages($menu, $title, $dis, $key, $description, $images123, $position, $active, $content, $home, $address, $id);
     }
     $id = $this->_request->getParam('id');
     $edit = $system->list_Pages_1($id);
     $this->view->books = $edit;
     $this->view->id = $id;
 }
开发者ID:lynguyetvan88,项目名称:webtuthien,代码行数:50,代码来源:PageController.php

示例4: uploadAction

 public function uploadAction()
 {
     $page_id = $this->_getParam('page_id');
     if ($this->getRequest()->isPost()) {
         $uploadPath = APPLICATION_ROOT . '/public_html/images/page';
         //var_dump($uploadPath);die();
         $uploadAdapter = new Zend_File_Transfer_Adapter_Http();
         $uploadAdapter->setDestination($uploadPath);
         $uploadAdapter->setOptions(array('ignoreNoFile' => true));
         $extValidator = new Zend_Validate_File_Extension('jpg,png,gif');
         $extValidator->setMessage('Ongeldige foto extensie', Zend_Validate_File_Extension::FALSE_EXTENSION);
         $uploadAdapter->addValidator($extValidator);
         $uploadAdapter->receive();
         $messages = $uploadAdapter->getMessages();
         if (count($messages)) {
             $this->_helper->layout()->disableLayout();
             $this->view->result = Zend_Json::encode(array('success' => false));
             return;
         }
         $basePath = APPLICATION_ROOT . '/public_html/images/page/page_' . $page_id;
         $old_umask = umask(0);
         if (!is_dir($basePath)) {
             mkdir($basePath, 0777, true);
         }
         if (!is_dir($basePath . '/100x100')) {
             mkdir($basePath . '/100x100', 0777, true);
         }
         if (!is_dir($basePath . '/726x1035')) {
             mkdir($basePath . '/726x1035', 0777, true);
         }
         umask($old_umask);
         $files = $uploadAdapter->getFilename(null, false);
         if (!is_array($files)) {
             $files = array($files);
         }
         $text = $this->_getParam('text');
         foreach ($files as $key => $filename) {
             $picnumber = substr($key, 8, 1);
             $oFname = $uploadPath . '/' . $filename;
             if (!$oFname) {
                 continue;
             }
             $ext = '.' . strtolower(substr(strrchr($oFname, '.'), 1));
             $nFname = $basePath . '/' . md5(time() . $oFname) . $ext;
             rename($oFname, $nFname);
             $im = new Imagick($nFname);
             $im->cropThumbnailImage(100, 100);
             $im->writeImage($basePath . '/100x100/' . basename($nFname));
             $im = new Imagick($nFname);
             $im->cropThumbnailImage(726, 1035);
             $im->writeImage($basePath . '/726x1035/' . basename($nFname));
             //count al items in DB en doe +1 voor de laatste positite aan de foto toe te kennen
             $x = new SxCms_Page_Picture_Proxy();
             $x = $x->countByPage($page_id) + 1;
             //save pic
             $picture = new SxCms_Page_Picture();
             $picture->setPageId($page_id);
             $picture->setFile(basename($nFname));
             $picture->setText($text[$picnumber]);
             $picture->setSeason(0);
             $picture->setPlace($x);
             $picture->save();
         }
         $this->_helper->layout()->disableLayout();
         $this->view->result = Zend_Json::encode(array('success' => true));
         $this->render('result');
     }
 }
开发者ID:sonvq,项目名称:2015_freelance6,代码行数:68,代码来源:PictureController.php

示例5: editpartnersAction

 function editpartnersAction()
 {
     $system = new Admin_Model_Side();
     if ($this->_request->isPost()) {
         $this->view->purifier = Zend_Registry::get('purifier');
         $conf = HTMLPurifier_Config::createDefault();
         $purifier = new HTMLPurifier($conf);
         $title = $purifier->purify($this->_request->getParam('title'));
         $description = $purifier->purify($this->_request->getParam('description'));
         $link = $purifier->purify($this->_request->getParam('link'));
         $position = $purifier->purify($this->_request->getParam('position'));
         $img = $purifier->purify($this->_request->getParam('images'));
         $test = $_FILES['images']['name'];
         if ($test == '') {
             $images123 = $purifier->purify($this->_request->getParam('images_hiden'));
         } else {
             $upload = new Zend_File_Transfer_Adapter_Http();
             $images = $upload->getFilename();
             $images = basename($images);
             $random_digit = rand(00, 99999);
             $img = $random_digit . $images;
             $filterRename = new Zend_Filter_File_Rename(array('target' => 'Upload/' . $random_digit . $images, 'overwrite' => false));
             $upload->addFilter($filterRename);
             $upload->receive();
             $images123 = $img;
         }
         $id = $this->_request->getParam('id');
         $system->update_side($images123, $title, $description, $link, $position, 1, $id);
     }
     $id = $this->_request->getParam('id');
     $edit = $system->list_side_1($id);
     $this->view->books = $edit;
 }
开发者ID:lynguyetvan88,项目名称:webtuthien,代码行数:33,代码来源:SideController.php


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