/** * Sınıfı başlatır ve resim yüklenebilmesi için gerekli ortamı hazırlar * * @param array $file * @param string $target */ public function __construct(array $file = [], $target = '') { parent::__construct($file, $target); $types = $this->getDefaultImageTypes(); $this->setAllowedMimeTypes($types->getImageMimeTypes()); $this->setAllowedExt($types->getImageTypeExt(), ['.php']); }
/** * Constructor * * @param string $name nombre de archivo por metodo POST */ public function __construct($name) { parent::__construct($name); $this->_imgInfo = getimagesize($_FILES[$name]['tmp_name']); // Ruta donde se guardara el archivo $this->_path = dirname($_SERVER['SCRIPT_FILENAME']) . '/img/upload'; }
function __construct() { parent::__construct(); $this->commentRatingMngr = new Rating('commentRatings', 'comments'); $this->commentMngr = new Comment_v0(1, GlobalMas::$filesPath_web); //FileFolder::delete(GlobalMas::$filesPath_absolute); }
public function __construct($arrAttributes = null) { // check against arrAttributes, as 'onsubmit_callback' => 'multifileupload_moveFiles' does not provide valid attributes if ($arrAttributes !== null && !$arrAttributes['uploadFolder']) { throw new \Exception(sprintf($GLOBALS['TL_LANG']['ERR']['noUploadFolderDeclared'], $this->name)); } $arrAttributes['uploadAction'] = static::$uploadAction; if (TL_MODE == 'FE') { $arrAttributes['uploadActionParams'] = http_build_query(AjaxAction::getParams(MultiFileUpload::NAME, static::$uploadAction)); } $arrAttributes['addRemoveLinks'] = isset($arrAttributes['addRemoveLinks']) ? $arrAttributes['addRemoveLinks'] : true; if (!is_array($arrAttributes['value']) && !Validator::isBinaryUuid($arrAttributes['value'])) { $arrAttributes['value'] = json_decode($arrAttributes['value']); } // bin to string -> never pass binary to the widget!! if ($arrAttributes['value']) { if (is_array($arrAttributes['value'])) { $arrAttributes['value'] = array_map(function ($val) { return \Validator::isBinaryUuid($val) ? \StringUtil::binToUuid($val) : $val; }, $arrAttributes['value']); } else { $arrAttributes['value'] = array(\Validator::isBinaryUuid($arrAttributes['value']) ? \StringUtil::binToUuid($arrAttributes['value']) : $arrAttributes['value']); } } parent::__construct($arrAttributes); $this->objUploader = new MultiFileUpload($arrAttributes); // add onsubmit_callback: move files after form submission $GLOBALS['TL_DCA'][$this->strTable]['config']['onsubmit_callback']['multifileupload_moveFiles'] = array('HeimrichHannot\\MultiFileUpload\\FormMultiFileUpload', 'moveFiles'); Ajax::runActiveAction(MultiFileUpload::NAME, MultiFileUpload::ACTION_UPLOAD, $this); }
public function __construct($config) { parent::__construct($config); $this->config = array("pathFormat" => $config['scrawlPathFormat'], "maxSize" => $config['scrawlMaxSize'], "allowFiles" => $config['scrawlAllowFiles'], "oriName" => "scrawl.png"); $this->fieldName = $config['scrawlFieldName']; $this->base64 = "base64"; }
/** * Constructor * * @param string $path chemin vers l'image * @param string $ext extention de l'image * @return void */ public function __construct($name) { parent::__construct($name); $this->ext = $this->infos['extension']; if ($this->ext == 'jpg') { $this->ext = 'jpeg'; } $this->maxsize = 512000; // 1MO }
/** * Método construtor * @param array $Files Files do arquivo. Ex.: $_FILES['arquivo'] * @param string $destination Path completo do destino do arquivo * @param mixed $customRename Nome customizado para o arquivo */ public function __construct($Files, $destination, $customRename = false) { parent::__construct($Files, $destination, $customRename); }
/** * Constructor * * @param string $name nombre de archivo por metodo POST */ public function __construct($name) { parent::__construct($name); // Ruta donde se guardara el archivo $this->_path = dirname(APP_PATH) . '/public/files/upload'; }
/** * Constructor * * @param string $name nombre de archivo por metodo POST */ public function __construct($name) { parent::__construct($name); // Ruta donde se guardara el archivo $this->_path = dirname($_SERVER['SCRIPT_FILENAME']) . '/files/upload'; }
public function __construct() { parent::__construct(); }
public function __construct($config) { parent::__construct($config); $this->config = array("pathFormat" => $config['videoPathFormat'], "maxSize" => $config['videoMaxSize'], "allowFiles" => $config['videoAllowFiles']); $this->fieldName = $config['videoFieldName']; }
/** * Método construtor * @param array $Files Files do arquivo. Ex.: $_FILES['arquivo'] * @param string $destination Path completo do destino do arquivo * @param mixed $customRename Nome customizado para o arquivo */ public function __construct($Files, $destination, $customRename = false) { parent::__construct($Files, $destination, $customRename); $this->detination = parent::getDestination() . '/' . parent::getNewName(); $this->info = getimagesize(parent::getTmpName()); }
/** * Requires data from validation class to avoid the need of reforming $_FILES array twice * @param object of type ValidateFile $validator * @param string $id - book id * @return object */ public function __construct(ValidateFile $validator, $id) { parent::__construct($validator); $this->id = $id; }