Location: PHPKode > projects > Energine > energine-2.2/doc/api/energine/core/FileUploader.html
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
			<title>Docs For Class FileUploader</title>
			<link rel="stylesheet" href="../../media/stylesheet.css" />
						<script src="../../media/lib/classTree.js"></script>
												<script language="javascript" type="text/javascript">
				var imgPlus = new Image();
				var imgMinus = new Image();
				imgPlus.src = "../../media/images/plus.png";
				imgMinus.src = "../../media/images/minus.png";
				
				function showNode(Node){
							switch(navigator.family){
								case 'nn4':
									// Nav 4.x code fork...
							var oTable = document.layers["span" + Node];
							var oImg = document.layers["img" + Node];
									break;
								case 'ie4':
									// IE 4/5 code fork...
							var oTable = document.all["span" + Node];
							var oImg = document.all["img" + Node];
									break;
								case 'gecko':
									// Standards Compliant code fork...
							var oTable = document.getElementById("span" + Node);
							var oImg = document.getElementById("img" + Node);
									break;
							}
					oImg.src = imgMinus.src;
					oTable.style.display = "block";
				}
				
				function hideNode(Node){
							switch(navigator.family){
								case 'nn4':
									// Nav 4.x code fork...
							var oTable = document.layers["span" + Node];
							var oImg = document.layers["img" + Node];
									break;
								case 'ie4':
									// IE 4/5 code fork...
							var oTable = document.all["span" + Node];
							var oImg = document.all["img" + Node];
									break;
								case 'gecko':
									// Standards Compliant code fork...
							var oTable = document.getElementById("span" + Node);
							var oImg = document.getElementById("img" + Node);
									break;
							}
					oImg.src = imgPlus.src;
					oTable.style.display = "none";
				}
				
				function nodeIsVisible(Node){
							switch(navigator.family){
								case 'nn4':
									// Nav 4.x code fork...
							var oTable = document.layers["span" + Node];
									break;
								case 'ie4':
									// IE 4/5 code fork...
							var oTable = document.all["span" + Node];
									break;
								case 'gecko':
									// Standards Compliant code fork...
							var oTable = document.getElementById("span" + Node);
									break;
							}
					return (oTable && oTable.style.display == "block");
				}
				
				function toggleNodeVisibility(Node){
					if (nodeIsVisible(Node)){
						hideNode(Node);
					}else{
						showNode(Node);
					}
				}
			</script>
					</head>
		<body>
			<div class="page-body">			
<h2 class="class-name"><img src="../../media/images/Class_logo.png"
														alt=" Class"
														title=" Class"
														style="vertical-align: middle"> FileUploader</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
													<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
						|											<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
					</div>
	<div class="info-box-body">
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Загрузчик файлов на сервер.</p>
		<p class="notes">
			Located in <a class="field" href="_framework---FileUploader.class.php.html">/framework/FileUploader.class.php</a> (line <span class="field"><a href="../../__filesource/fsource_energine_core_frameworkFileUploader.class.php.html#a20">20</a></span>)
		</p>
		
				
		<pre><a href="../../energine/core/Object.html">Object</a>
   |
   --FileUploader</pre>
	
			</div>
</div>



	<a name="sec-var-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Variable Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
						<span class="disabled">Vars</span> (<a href="#sec-vars">details</a>)
							| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
								</div>
		<div class="info-box-body">
			<div class="var-summary">
																																																																								<div class="var-title">
					<img src="../../media/images/PrivateVariable.png" alt=" " />
					<span class="var-type">string</span>
					<a href="#$ext" title="details" class="var-name">$ext</a>
				</div>
																<div class="var-title">
					<img src="../../media/images/PrivateVariable.png" alt=" " />
					<span class="var-type">array</span>
					<a href="#$file" title="details" class="var-name">$file</a>
				</div>
																<div class="var-title">
					<img src="../../media/images/PrivateVariable.png" alt=" " />
					<span class="var-type">string</span>
					<a href="#$FileObjectName" title="details" class="var-name">$FileObjectName</a>
				</div>
																<div class="var-title">
					<img src="../../media/images/PrivateVariable.png" alt=" " />
					<span class="var-type">array</span>
					<a href="#$restrictions" title="details" class="var-name">$restrictions</a>
				</div>
																<div class="var-title">
					<img src="../../media/images/PrivateVariable.png" alt=" " />
					<span class="var-type">string</span>
					<a href="#$type" title="details" class="var-name">$type</a>
				</div>
																<div class="var-title">
					<img src="../../media/images/PrivateVariable.png" alt=" " />
					<span class="var-type">string</span>
					<a href="#$uploadsPath" title="details" class="var-name">$uploadsPath</a>
				</div>
																<div class="var-title">
					<img src="../../media/images/PrivateVariable.png" alt=" " />
					<span class="var-type">boolean</span>
					<a href="#$validated" title="details" class="var-name">$validated</a>
				</div>
											</div>
		</div>
	</div>

	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
																		<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
				 
				|
						<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
																																																																															
				<div class="method-definition">
					<img src="../../media/images/Constructor.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#__construct" title="details" class="method-name">__construct</a>
										()
									</div>
															
				<div class="method-definition">
					<img src="../../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#cleanUp" title="details" class="method-name">cleanUp</a>
										()
									</div>
															
				<div class="method-definition">
					<img src="../../media/images/Method.png" alt=" "/>
											<span class="method-result">string</span>
										<a href="#getExtension" title="details" class="method-name">getExtension</a>
										()
									</div>
															
				<div class="method-definition">
					<img src="../../media/images/Method.png" alt=" "/>
											<span class="method-result">string</span>
										<a href="#getFileObjectName" title="details" class="method-name">getFileObjectName</a>
										()
									</div>
															
				<div class="method-definition">
					<img src="../../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#setFile" title="details" class="method-name">setFile</a>
											(<span class="var-type"></span>&nbsp;<span class="var-name">$file</span>)
									</div>
															
				<div class="method-definition">
					<img src="../../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#setRestrictions" title="details" class="method-name">setRestrictions</a>
											(<span class="var-type"></span>&nbsp;<span class="var-name">$restrictions</span>)
									</div>
															
				<div class="method-definition">
					<img src="../../media/images/Method.png" alt=" "/>
											<span class="method-result">boolean</span>
										<a href="#upload" title="details" class="method-name">upload</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$dir</span>)
									</div>
															
				<div class="method-definition">
					<img src="../../media/images/Method.png" alt=" "/>
											<span class="method-result">boolean</span>
										<a href="#validate" title="details" class="method-name">validate</a>
										()
									</div>
											</div>
		</div>
	</div>		

	<a name="sec-vars"></a>
	<div class="info-box">
		<div class="info-box-title">Variables</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
										<a href="#sec-var-summary">Vars</a> (<span class="disabled">details</span>)
						
			
										| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
					</div>
		<div class="info-box-body">
			
<a name="var$ext" id="$ext"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<img src="../../media/images/PrivateVariable.png" />
		<span class="var-title">
			<span class="var-type">string</span>
			<span class="var-name">$ext</span>
						(line <span class="line-number"><a href="../../__filesource/fsource_energine_core_frameworkFileUploader.class.php.html#a47">47</a></span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">var:</span> расширение файла</li>
				<li><span class="field">access:</span> private</li>
			</ul>
	
	
		
		

</div>
<a name="var$file" id="$file"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<img src="../../media/images/PrivateVariable.png" />
		<span class="var-title">
			<span class="var-type">array</span>
			<span class="var-name">$file</span>
			 = <span class="var-default">array()</span>			(line <span class="line-number"><a href="../../__filesource/fsource_energine_core_frameworkFileUploader.class.php.html#a27">27</a></span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">var:</span> описание загружаемого файла</li>
				<li><span class="field">see:</span> PHP manual, POST method uploads</li>
				<li><span class="field">access:</span> private</li>
			</ul>
	
	
		
		

</div>
<a name="var$FileObjectName" id="$FileObjectName"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<img src="../../media/images/PrivateVariable.png" />
		<span class="var-title">
			<span class="var-type">string</span>
			<span class="var-name">$FileObjectName</span>
						(line <span class="line-number"><a href="../../__filesource/fsource_energine_core_frameworkFileUploader.class.php.html#a53">53</a></span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">var:</span> имя, под которым загруженный файл сохранен на сервере</li>
				<li><span class="field">access:</span> private</li>
			</ul>
	
	
		
		

</div>
<a name="var$restrictions" id="$restrictions"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<img src="../../media/images/PrivateVariable.png" />
		<span class="var-title">
			<span class="var-type">array</span>
			<span class="var-name">$restrictions</span>
			 = <span class="var-default">array()</span>			(line <span class="line-number"><a href="../../__filesource/fsource_energine_core_frameworkFileUploader.class.php.html#a41">41</a></span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">var:</span> ограничения для загружаемого файла</li>
				<li><span class="field">access:</span> private</li>
			</ul>
	
	
		
		

</div>
<a name="var$type" id="$type"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<img src="../../media/images/PrivateVariable.png" />
		<span class="var-title">
			<span class="var-type">string</span>
			<span class="var-name">$type</span>
						(line <span class="line-number"><a href="../../__filesource/fsource_energine_core_frameworkFileUploader.class.php.html#a35">35</a></span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Mime Type</p>
	<ul class="tags">
				<li><span class="field">access:</span> private</li>
			</ul>
	
	
		
		

</div>
<a name="var$uploadsPath" id="$uploadsPath"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<img src="../../media/images/PrivateVariable.png" />
		<span class="var-title">
			<span class="var-type">string</span>
			<span class="var-name">$uploadsPath</span>
			 = <span class="var-default"> ''</span>			(line <span class="line-number"><a href="../../__filesource/fsource_energine_core_frameworkFileUploader.class.php.html#a59">59</a></span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">var:</span> путь к корневому каталогу загружаемых файлов</li>
				<li><span class="field">access:</span> private</li>
			</ul>
	
	
		
		

</div>
<a name="var$validated" id="$validated"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<img src="../../media/images/PrivateVariable.png" />
		<span class="var-title">
			<span class="var-type">boolean</span>
			<span class="var-name">$validated</span>
			 = <span class="var-default"> false</span>			(line <span class="line-number"><a href="../../__filesource/fsource_energine_core_frameworkFileUploader.class.php.html#a65">65</a></span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">var:</span> флаг, указывающий была ли произведена валидация (проверяется методом upload)</li>
				<li><span class="field">access:</span> private</li>
			</ul>
	
	
		
		

</div>
							<h4>Inherited Variables</h4>
				<A NAME='inherited_vars'><!-- --></A>
									<p>Inherited from <span class="classname"><a href="../../energine/core/Object.html">Object</a></span></p>
					<blockquote>
													<img src="../../media/images/PrivateVariable.png" />
							<span class="var-title">
								<span class="var-name"><a href="../../energine/core/Object.html#var$executionTime">Object::$executionTime</a></span><br>
							</span>
											</blockquote> 
										
		</div>
	</div>
	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
															<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
																	<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>
<a name="method__construct" id="__construct"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../../media/images/Constructor.png" />
		<span class="method-title">Constructor __construct</span> (line <span class="line-number"><a href="../../__filesource/fsource_energine_core_frameworkFileUploader.class.php.html#a75">75</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Конструктор класса.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			__construct
		</span>
				()
			</div>
	
		
			<hr class="separator" />
		<div class="notes">Redefinition of:</div>
		<dl>
			<dt><a href="../../energine/core/Object.html#method__construct">Object::__construct()</a></dt>
						<dd>Конструктор класса.</dd>
					</dl>
			
	</div>
<a name="methodcleanUp" id="cleanUp"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../../media/images/Method.png" />
		<span class="method-title">cleanUp</span> (line <span class="line-number"><a href="../../__filesource/fsource_energine_core_frameworkFileUploader.class.php.html#a230">230</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Очищает состояние объекта для повторного использования.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			cleanUp
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodgetExtension" id="getExtension"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../../media/images/Method.png" />
		<span class="method-title">getExtension</span> (line <span class="line-number"><a href="../../__filesource/fsource_energine_core_frameworkFileUploader.class.php.html#a220">220</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Возвращает расширение файла.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			getExtension
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodgetFileObjectName" id="getFileObjectName"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../../media/images/Method.png" />
		<span class="method-title">getFileObjectName</span> (line <span class="line-number"><a href="../../__filesource/fsource_energine_core_frameworkFileUploader.class.php.html#a210">210</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Возвращает имя загруженного файла.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			getFileObjectName
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodsetFile" id="setFile"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../../media/images/Method.png" />
		<span class="method-title">setFile</span> (line <span class="line-number"><a href="../../__filesource/fsource_energine_core_frameworkFileUploader.class.php.html#a113">113</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Устанавливает описание файла.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			setFile
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$file</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$file</span>			</li>
				</ul>
		
			
	</div>
<a name="methodsetRestrictions" id="setRestrictions"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../../media/images/Method.png" />
		<span class="method-title">setRestrictions</span> (line <span class="line-number"><a href="../../__filesource/fsource_energine_core_frameworkFileUploader.class.php.html#a102">102</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Устанавливает ограничения которым должен соответствовать загружаемый</p>
<p class="description"><p>Для изображений:      array(          'width'   =&gt; integer, // ширина ищображения          'height'  =&gt; integer, // высота изображения          'precise' =&gt; boolean  // true - точный размер, false - не более указанного (по-умолчанию),          'max' =&gt; integer //максимальный размер файла          'type' =&gt;      )</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			setRestrictions
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$restrictions</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$restrictions</span>			</li>
				</ul>
		
			
	</div>
<a name="methodupload" id="upload"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../../media/images/Method.png" />
		<span class="method-title">upload</span> (line <span class="line-number"><a href="../../__filesource/fsource_energine_core_frameworkFileUploader.class.php.html#a174">174</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Фактическая загрузка файла в определенную директорию.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">boolean</span>
		<span class="method-name">
			upload
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$dir</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$dir</span><span class="var-description">: директория внутри корневого каталога загружаемых файлов</span>			</li>
				</ul>
		
			
	</div>
<a name="methodvalidate" id="validate"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../../media/images/Method.png" />
		<span class="method-title">validate</span> (line <span class="line-number"><a href="../../__filesource/fsource_energine_core_frameworkFileUploader.class.php.html#a127">127</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Валидация загружаемого файла.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">boolean</span>
		<span class="method-name">
			validate
		</span>
				()
			</div>
	
		
			
	</div>
							<h4>Inherited Methods</h4>
				<a name='inherited_methods'><!-- --></a>	
									<!-- =========== Summary =========== -->
					<p>Inherited From <span class="classname"><a href="../../energine/core/Object.html">Object</a></span></p>
					<blockquote>
													<img src="../../media/images/Constructor.png" alt=" "/>
							<span class="method-name"><a href="../../energine/core/Object.html#method__construct">Object::__construct()</a></span><br>
													<img src="../../media/images/Method.png" alt=" "/>
							<span class="method-name"><a href="../../energine/core/Object.html#methodgetExecutionTime">Object::getExecutionTime()</a></span><br>
													<img src="../../media/images/Method.png" alt=" "/>
							<span class="method-name"><a href="../../energine/core/Object.html#methodstartExecutionTimer">Object::startExecutionTimer()</a></span><br>
													<img src="../../media/images/Method.png" alt=" "/>
							<span class="method-name"><a href="../../energine/core/Object.html#methodstopExecutionTimer">Object::stopExecutionTimer()</a></span><br>
											</blockquote>
										
		</div>
	</div>

	
	<p class="notes" id="credit">
		Documentation generated on Mon, 17 Sep 2007 13:29:22 +0300 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.0a2</a>
	</p>
	</div></body>
</html>
Return current item: Energine