well, when you upload a file via the post method, it's saved in a temp location.
To access it, use $HTTP_POST_FILES['getFileName']['tmp_name']
'getFileName' is the name of the field you gave which people use to browse for the files.
i.e. <input type="file" name="upFile">
thus $HTTP_POST_FILES['upFile']['tmp_name']
as you may notice, this is in the form of a multi-dimensional array, the second-level element in the array is 'tmp_name', there are other second-level elements :
'tmp_name' is the temporary name given to the file by PHP
'name' is the real name of the file... and so forth and so forth. you can find out more by searching the www.php.net site
search criteria HTTP_POST_FILES
then to save the file use this :
$fh = ''; // File handle set by fopen
$fh2 = ''; // File handle 2 set by second fopen
$fileBuffer = ''; // File buffer, the file info
$newFile = 'website/images/blah.jpg'; //new file
if ($fh = fopen( $HTTP_POST_FILES['upFile']['tmp_name'], 'r') ) {
$fileBuffer = fread( $fh, filesize( $HTTP_POST_FILES['upFile']['tmp_name'] ) );
fclose( $fh );
if ( $fh2 = fopen( $newFile, 'wb' ) ) {
fwrite( $fh2, $fileBuffer );
fclose( $fh2 );
} else {
echo 'could not create new file';
}
} else {
echo 'could not open uploaded file';
}