Skip to content
Snippets Groups Projects
Commit 443e4e80 authored by Alex Arnaud's avatar Alex Arnaud
Browse files

hotline#19216 - Remove size limit for file upload

parent f2a77c38
Branches
Tags
5 merge requests!715Master,!628Master,!625Hotline 6.59,!624Hotline 6.59,!619Hotline#19216 file upload limit
......@@ -22,9 +22,6 @@ class Class_MultiUpload {
/** @var Zend_Controller_Request_Http */
protected $_request;
/** @var int */
protected $_sizeLimit = 10485760;
/** @var Class_MultiUpload_HandlerFactory */
protected $_handlerFactory;
......@@ -165,9 +162,6 @@ class Class_MultiUpload {
* @return bool
*/
public function handleUpload($uploadDirectory, $filename_prefix) {
if (!$this->_isPhpSettingsCompatible())
return false;
if (!$this->_setHandler())
return false;
......@@ -176,10 +170,8 @@ class Class_MultiUpload {
return false;
}
if ($size > $this->_sizeLimit) {
$this->_error = 'Fichier trop volumineux';
if (!$this->_isPhpSettingsCompatible($size))
return false;
}
$filename = $filename_prefix . '_' . $this->_handler->getName();
......@@ -227,17 +219,16 @@ class Class_MultiUpload {
/**
* @return bool
*/
protected function _isPhpSettingsCompatible() {
protected function _isPhpSettingsCompatible($size) {
$settingsReader = $this->getSettingsReader();
$postSize = $this->_toBytes($settingsReader->get('post_max_size'));
$uploadSize = $this->_toBytes($settingsReader->get('upload_max_filesize'));
if (
($postSize < $this->_sizeLimit )
|| ($uploadSize < $this->_sizeLimit)
($postSize < $size )
|| ($uploadSize < $size)
) {
$size = max(array(1, $this->_sizeLimit / 1024 / 1024)) . 'M';
$this->_error = 'Paramétrage du serveur : monter le post_max_size et le upload_max_filesize à ' . $size;
$this->_error = 'Fichier trop volumineux. Paramétrage du serveur : monter le post_max_size et le upload_max_filesize à ' . $size;
return false;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment