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


PHP Varien_File_Uploader::setFilenamesCaseSensitivity方法代码示例

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


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

示例1: saveAvatarFile

 public function saveAvatarFile()
 {
     $uploadedFile = null;
     if ($fileData = $this->getAvatarFileData()) {
         $uploader = new Varien_File_Uploader($this->getAvatarFileData());
         $uploader->setFilesDispersion(true);
         $uploader->setFilenamesCaseSensitivity(false);
         $uploader->setAllowRenameFiles(true);
         $uploader->setAllowedExtensions($this->_supportedExtensions);
         $uploader->save($this->getAvatarBasePath(), $fileData['name']);
         $uploadedFile = $uploader->getUploadedFileName();
     }
     return $uploadedFile;
 }
开发者ID:monarcmoso,项目名称:beta2,代码行数:14,代码来源:Avatar.php

示例2: compactValue

 /**
  * Export attribute value to entity model
  *
  * @param Mage_Core_Model_Abstract $entity
  * @param array|string $value
  * @return Mage_Eav_Model_Attribute_Data_File
  */
 public function compactValue($value)
 {
     if ($this->getIsAjaxRequest()) {
         return $this;
     }
     $attribute = $this->getAttribute();
     $original = $this->getEntity()->getData($attribute->getAttributeCode());
     $toDelete = false;
     if ($original) {
         if (!$attribute->getIsRequired() && !empty($value['delete'])) {
             $toDelete = true;
         }
         if (!empty($value['tmp_name'])) {
             $toDelete = true;
         }
     }
     $path = Mage::getBaseDir('media') . DS . $attribute->getEntity()->getEntityTypeCode();
     // unlink entity file
     if ($toDelete) {
         $this->getEntity()->setData($attribute->getAttributeCode(), '');
         $file = $path . $original;
         $ioFile = new Varien_Io_File();
         if ($ioFile->fileExists($file)) {
             $ioFile->rm($file);
         }
     }
     if (!empty($value['tmp_name'])) {
         try {
             $uploader = new Varien_File_Uploader($value);
             $uploader->setFilesDispersion(true);
             $uploader->setFilenamesCaseSensitivity(false);
             $uploader->setAllowRenameFiles(true);
             $uploader->save($path, $value['name']);
             $fileName = $uploader->getUploadedFileName();
             $this->getEntity()->setData($attribute->getAttributeCode(), $fileName);
         } catch (Exception $e) {
             Mage::logException($e);
         }
     }
     return $this;
 }
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:48,代码来源:File.php

示例3: saveAction

 public function saveAction()
 {
     $post_data = $this->getRequest()->getPost();
     if ($post_data) {
         try {
             $path = Mage::getBaseDir('media') . DS . 'cdz' . DS . 'revslideshow' . DS . 'images';
             foreach ($_FILES as $key => $value) {
                 $temp = explode("_", $key);
                 if (!empty($value['tmp_name'])) {
                     try {
                         $uploader = new Varien_File_Uploader($value);
                         $uploader->setAllowedExtensions(array('jpg', 'jpeg', 'gif', 'png'));
                         $uploader->setFilesDispersion(false);
                         $uploader->setFilenamesCaseSensitivity(false);
                         $uploader->setAllowRenameFiles(true);
                         $imageName = Mage::helper('revslideshow')->replaceFileName($value['name']);
                         $uploader->save($path, $imageName);
                         $fileName = $uploader->getUploadedFileName();
                         $post_data['slider'][$temp[1]]['image'] = $fileName;
                     } catch (Exception $e) {
                         Mage::logException($e);
                         Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
                     }
                 }
             }
             foreach ($post_data['slider'] as $key => $value) {
                 if (!$post_data['slider'][$key]['image']) {
                     $post_data['slider'][$key]['image'] = $value[$key]['image'];
                 }
             }
             $model = Mage::getModel("revslideshow/revslideshow");
             if (isset($post_data["duplicate"])) {
                 $model->setId();
             } else {
                 $model->setId($this->getRequest()->getParam("id"));
             }
             $post_data['general_settings'] = json_encode($post_data['general_settings'], JSON_HEX_TAG);
             $post_data['appearance'] = json_encode($post_data['appearance'], JSON_HEX_TAG);
             $post_data['loop'] = json_encode($post_data['loop'], JSON_HEX_TAG);
             $post_data['mobile_settings'] = json_encode($post_data['mobile_settings'], JSON_HEX_TAG);
             $post_data['navigation'] = json_encode($post_data['navigation'], JSON_HEX_TAG);
             $post_data['parallax'] = json_encode($post_data['parallax'], JSON_HEX_TAG);
             $post_data['spinner'] = json_encode($post_data['spinner'], JSON_HEX_TAG);
             $post_data['slider'] = json_encode($post_data['slider'], JSON_HEX_TAG);
             $post_data['thumbnails'] = json_encode($post_data['thumbnails'], JSON_HEX_TAG);
             $model->addData($post_data);
             $model->save();
             Mage::getSingleton("adminhtml/session")->addSuccess(Mage::helper("adminhtml")->__("Revslideshow was successfully saved"));
             Mage::getSingleton("adminhtml/session")->setRevslideshowData(false);
             if ($this->getRequest()->getParam("back")) {
                 $this->_redirect("*/*/edit", array("id" => $model->getId()));
                 return;
             }
             $this->_redirect("*/*/");
             return;
         } catch (Exception $e) {
             Mage::getSingleton("adminhtml/session")->addError($e->getMessage());
             Mage::getSingleton("adminhtml/session")->setRevslideshowData($this->getRequest()->getPost());
             $this->_redirect("*/*/edit", array("id" => $this->getRequest()->getParam("id")));
             return;
         }
     }
     $this->_redirect("*/*/");
 }
开发者ID:CodazonGroup,项目名称:coda,代码行数:64,代码来源:RevslideshowController.php


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