|
|
|
|
|
|
(Since version FH3-v1.2)
GetFileInfo |
GetFileInfo (
) |
Arguments:
Name |
Description |
$uploadfield |
The name of the uploadfield where the file is uploaded. |
Description:
With this function you can retrieve the data of an uploaded file retrieved from the $_FILES array.
Please note that this function will not work after calling flush(). It will work in the onCorrect and onSaved functions.
Example
<?php
// include the formhandler
include("FH3/class.FormHandler.php");
// create a new instance of FormHandler
$form = new FormHandler();
// the uploadfield
$form -> uploadField("file", "file");
// is there a file uploaded?
if( $form -> IsUploaded( "file" ) )
{
// get the data as in the $_FILES array
$data = $form -> GetFileInfo("file");
// show the data
echo '<pre>';
print_r( $data );
echo '</pre>';
}
// button to submit the form
$form -> submitbutton();
// show the form
$form -> flush();
?>
|
The result will be:
Array
(
[name] => newlogo.gif
[type] => image/gif
[tmp_name] => C:\WINDOWS\TEMP\php6.tmp
[error] => 0
[size] => 5902
)
|
See also: UploadField
Latest change: 19 February 07 / 20:07
Comments
|
|
|
|