當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UploadHandler::iniBytes方法代碼示例

本文整理匯總了PHP中UploadHandler::iniBytes方法的典型用法代碼示例。如果您正苦於以下問題:PHP UploadHandler::iniBytes方法的具體用法?PHP UploadHandler::iniBytes怎麽用?PHP UploadHandler::iniBytes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在UploadHandler的用法示例。


在下文中一共展示了UploadHandler::iniBytes方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

		}
		return $return;
	}
}

//	statically set default language vars - an app that needs to customize messages can do so after including this class (only needs to happen once)

UploadHandler::$i18n = array(
	'UPLOADHANDLER_ERR_PROCESS_POST_SIZE'	=> 'POST size of %1$d bytes exceeds the limit set in php.ini#post_max_size of %2$d bytes.',
	'UPLOADHANDLER_ERR_PROCESS_NO_INPUT'	=> 'No file input fields were detected in the POST request.',
	'UPLOADHANDLER_ERR_MOVE_EXISTS'			=> 'Could not move uploaded file "%1$s" to "%2$s" as the destination file already exists and the overwrite option was not set.',
	'UPLOAD_ERR_INI_SIZE'					=> 'The uploaded file exceeds the upload_max_filesize directive in php.ini.',
	'UPLOAD_ERR_FORM_SIZE'					=> 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.',
	'UPLOAD_ERR_PARTIAL'					=> 'The uploaded file was only partially uploaded.',
	'UPLOAD_ERR_NO_FILE'					=> 'No file was uploaded.',
	'UPLOAD_ERR_NO_TMP_DIR'					=> 'Missing a temporary folder.',
	'UPLOAD_ERR_CANT_WRITE'					=> 'Failed to write file to disk.',
	'UPLOAD_ERR_EXTENSION'					=> 'File upload stopped by extension.',
);

//	statically set some values that do not change throughout the lifetime of a request

UploadHandler::$contentLength = (int)@$_SERVER['CONTENT_LENGTH'];
UploadHandler::$maxPostSize = UploadHandler::iniBytes(ini_get('post_max_size'));

// store this for informational purposes only - php upload support will internally deny uploads which are over this size but client-side code can use this to advise of file size limits
UploadHandler::$uploadMaxFilesize = UploadHandler::iniBytes(ini_get('upload_max_filesize'));

// the lowest of both maxPostSize and uploadMaxFile size determines the maximum size of a single file upload (may not be accurate to the byte since there's some POST overhead if max POST size happens to be smaller than max file size)
UploadHandler::$maxUploadSize = min(UploadHandler::$uploadMaxFilesize, UploadHandler::$maxPostSize);
開發者ID:hungnv0789,項目名稱:vhtm,代碼行數:30,代碼來源:uploadhandler.php


注:本文中的UploadHandler::iniBytes方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。