public function upload($url = null, $maxfilesize = 0, $acceptfiletypes = null, $redirecturl = null, $btnTitle = null, $btnClass = null) {
		if (empty($url)) {
			return null;
		}

		if (empty($btnTitle)) {
			$btnTitle = $this->ViewExtension->iconTag('fas fa-file-upload') . '&nbsp;' . $this->_getOptionsForElem('upload.btnTitle');
		}
		if (empty($btnClass)) {
			$btnClass = 'btn-success';
		}
		$inputId = uniqid('input_');
		$progressId = uniqid('progress_');
		$filesId = uniqid('files_');
		$inputOptions = [
			'id' => $inputId,
			'data-progress-id' => $progressId,
			'data-files-id' => $filesId,
			'data-fileupload-url' => $url,
			'data-fileupload-maxfilesize' => $maxfilesize,
			'data-fileupload-acceptfiletypes' => $acceptfiletypes,
			'data-fileupload-redirecturl' => $redirecturl
		];
		$optionsDefault = $this->_getOptionsForElem('upload.inputOpt');
		$result = $this->Html->tag(
			'span',
			$btnTitle . $this->input(null, $inputOptions + $optionsDefault),
			['class' => 'fileinput-button btn ' . $btnClass]
		) .
			$this->Html->tag('br') .
			$this->Html->tag('br') .
			$this->Html->div('progress', $this->Html->div('progress-bar progress-bar-success', ''), ['id' => $progressId]) .
			$this->Html->tag('hr') .
			$this->Html->div('files', '', ['id' => $filesId]) .
			$this->Html->tag('br');

		return $result;
	}
public function upload($url = null, $maxfilesize = 0, $acceptfiletypes = null, $redirecturl = null, $btnTitle = null, $btnClass = null) {
		if (empty($url)) {
			return null;
		}

		if (empty($btnTitle)) {
			$btnTitle = $this->ViewExtension->iconTag('fas fa-file-upload') . '&nbsp;' . $this->_getOptionsForElem('upload.btnTitle');
		}
		if (empty($btnClass)) {
			$btnClass = 'btn-success';
		}
		$inputId = uniqid('input_');
		$progressId = uniqid('progress_');
		$filesId = uniqid('files_');
		$inputOptions = [
			'id' => $inputId,
			'data-progress-id' => $progressId,
			'data-files-id' => $filesId,
			'data-fileupload-url' => $url,
			'data-fileupload-maxfilesize' => $maxfilesize,
			'data-fileupload-acceptfiletypes' => $acceptfiletypes,
			'data-fileupload-redirecturl' => $redirecturl
		];
		$optionsDefault = $this->_getOptionsForElem('upload.inputOpt');
		$result = $this->Html->tag(
			'span',
			$btnTitle . $this->input(null, $inputOptions + $optionsDefault),
			['class' => 'fileinput-button btn ' . $btnClass]
		) .
			$this->Html->tag('br') .
			$this->Html->tag('br') .
			$this->Html->div('progress', $this->Html->div('progress-bar progress-bar-success', ''), ['id' => $progressId]) .
			$this->Html->tag('hr') .
			$this->Html->div('files', '', ['id' => $filesId]) .
			$this->Html->tag('br');

		return $result;
	}
public function upload ( $ url = null , $ maxfilesize = 0 , $ acceptfiletypes = null , $ redirecturl = null , $ btnTitle = null , $ btnClass = null ) { if ( empty ( $ url ) ) { return null ; } if ( empty ( $ btnTitle ) ) { $ btnTitle = $ this -> ViewExtension -> iconTag ( 'fas fa-file-upload' ) . '&nbsp;' . $ this -> _getOptionsForElem ( 'upload.btnTitle' ) ; } if ( empty ( $ btnClass ) ) { $ btnClass = 'btn-success' ; } $ inputId = uniqid ( 'input_' ) ; $ progressId = uniqid ( 'progress_' ) ; $ filesId = uniqid ( 'files_' ) ; $ inputOptions = [ 'id' => $ inputId , 'data-progress-id' => $ progressId , 'data-files-id' => $ filesId , 'data-fileupload-url' => $ url , 'data-fileupload-maxfilesize' => $ maxfilesize , 'data-fileupload-acceptfiletypes' => $ acceptfiletypes , 'data-fileupload-redirecturl' => $ redirecturl ] ; $ optionsDefault = $ this -> _getOptionsForElem ( 'upload.inputOpt' ) ; $ result = $ this -> Html -> tag ( 'span' , $ btnTitle . $ this -> input ( null , $ inputOptions + $ optionsDefault ) , [ 'class' => 'fileinput-button btn ' . $ btnClass ] ) . $ this -> Html -> tag ( 'br' ) . $ this -> Html -> tag ( 'br' ) . $ this -> Html -> div ( 'progress' , $ this -> Html -> div ( 'progress-bar progress-bar-success' , '' ) , [ 'id' => $ progressId ] ) . $ this -> Html -> tag ( 'hr' ) . $ this -> Html -> div ( 'files' , '' , [ 'id' => $ filesId ] ) . $ this -> Html -> tag ( 'br' ) ; return $ result ; }
Creates a upload input widget.

@param string $url URL for upload
@param int $maxfilesize Maximum file size for upload, bytes.
@param string $acceptfiletypes PCRE for checking uploaded file,
e.g.: (\.|\/)(jpe?g)$.
@param string $redirecturl URL for redirect on successful upload.
@param string $btnTitle Title of upload button.
@param string $btnClass Class of upload button.
@return string An HTML text input element.
@see {@link https://blueimp.github.io/jQuery-File-Upload} File Upload
Creates a upload input widget .