| 1 |
lars |
1 |
<com:TContent ID="body" >
|
|
|
2 |
|
|
|
3 |
<h1 id="2501">TFileUpload</h1>
|
|
|
4 |
<com:DocLink ClassPath="System.Web.UI.WebControls.TFileUpload" />
|
|
|
5 |
|
|
|
6 |
<p id="300257" class="block-content">
|
|
|
7 |
<tt>TFileUpload</tt> displays a file upload field on a Web page. Upon postback, the text entered into the field will be treated as the (local) name of the file that is uploaded to the server.
|
|
|
8 |
</p>
|
|
|
9 |
<p id="300258" class="block-content">
|
|
|
10 |
<tt>TFileUpload</tt> raises an <tt>OnFileUpload</tt> event when it is post back. The property <tt>HasFile</tt> indicates whether the file upload is successful or not. If successful, the uploaded file may be saved on the server by calling <tt>saveAs()</tt> method.
|
|
|
11 |
</p>
|
|
|
12 |
<p id="300259" class="block-content">
|
|
|
13 |
The following properties give the information about the uploaded file:
|
|
|
14 |
</p>
|
|
|
15 |
<ul id="u1" class="block-content">
|
|
|
16 |
<li><tt>FileName</tt> - the original client-side file name without directory information.</li>
|
|
|
17 |
<li><tt>FileType</tt> - the MIME type of the uploaded file.</li>
|
|
|
18 |
<li><tt>FileSize</tt> - the file size in bytes.</li>
|
|
|
19 |
<li><tt>LocalName</tt> - the absolute file path of the uploaded file on the server. Note, this file will be deleted after the current page request is completed. Call <tt>saveAs()</tt> to save the uploaded file.</li>
|
|
|
20 |
</ul>
|
|
|
21 |
<p id="300260" class="block-content">
|
|
|
22 |
If the file upload is unsuccessful, the property <tt>ErrorCode</tt> gives the error code describing the cause of failure. See <a href="http://www.php.net/manual/en/features.file-upload.errors.php">PHP documentation</a> for a complete explanation of the possible error codes.
|
|
|
23 |
</p>
|
|
|
24 |
|
|
|
25 |
<com:RunBar PagePath="Controls.Samples.TFileUpload.Home" />
|
|
|
26 |
|
|
|
27 |
<div class="last-modified">$Id: FileUpload.page 1650 2007-01-24 06:55:32Z wei $</div></com:TContent>
|